unsafe

scala.caps.unsafe
object unsafe

Attributes

Experimental
true
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
unsafe.type

Members list

Type members

Classlikes

final class untrackedCaptures extends StaticAnnotation

Two usages:

Two usages:

  1. Marks the constructor parameter as untracked. The capture set of this parameter will not be included in the capture set of the constructed object.

  2. Marks a class field that has a cap in its capture set, so that the cap is not contributed to the class instance. Example:

    class A { val b B^ = ... }; new A()
    

    has type A^ since b contributes a cap. But

    class A { @untrackedCaptures val b: B^ = ... }; new A()
    

    has type A. The b field does not contribute its cap.

Attributes

Note

This should go into annotations. For now it is here, so that we can experiment with it quickly between minor releases

Supertypes
class Annotation
class Object
trait Matchable
class Any

Value members

Concrete methods

def unsafeAssumeSeparate(op: Any): op.type

A wrapper around code for which separation checks are suppressed.

A wrapper around code for which separation checks are suppressed.

Attributes

An unsafe variant of erasedValue that can be used as an escape hatch. Unlike the user-accessible compiletime.erasedValue, this version is assumed to be a pure expression, hence capability safe. But there is no proof of realizability, hence it is unsafe.

An unsafe variant of erasedValue that can be used as an escape hatch. Unlike the user-accessible compiletime.erasedValue, this version is assumed to be a pure expression, hence capability safe. But there is no proof of realizability, hence it is unsafe.

Attributes

Extensions

Extensions

extension [T](x: T)

A specific cast operation to remove a capture set. If argument is of type T^C, assume it is of type T instead. Calls to this method are treated specially by the capture checker.

A specific cast operation to remove a capture set. If argument is of type T^C, assume it is of type T instead. Calls to this method are treated specially by the capture checker.

Attributes