dotty.tools.dotc.core

MutableTyperState

Related Doc: package core

class MutableTyperState extends TyperState

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MutableTyperState
  2. TyperState
  3. Showable
  4. DotClass
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MutableTyperState(previous: TyperState, r: Reporter, isCommittable: Boolean)

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def commit()(implicit ctx: Context): Unit

    Commit typer state so that its information is copied into current typer state In addition (1) the owning state of undetermined or temporarily instantiated type variables changes from this typer state to the current one.

    Commit typer state so that its information is copied into current typer state In addition (1) the owning state of undetermined or temporarily instantiated type variables changes from this typer state to the current one. (2) Variables that were temporarily instantiated in the current typer state are permanently instantiated instead.

    A note on merging: An interesting test case is isApplicableSafe.scala. It turns out that this requires a context merge using the new &' operator. Sequence of actions: 1) Typecheck argument in typerstate 1. 2) Cache argument. 3) Evolve same typer state (to typecheck other arguments, say) leading to a different constraint. 4) Take typechecked argument in same state.

    It turns out that the merge is needed not just for isApplicableSafe but also for (e.g. erased-lubs.scala) as well as many parts of dotty itself.

    Definition Classes
    MutableTyperStateTyperState
  7. def constraint: Constraint

    The current constraint set

    The current constraint set

    Definition Classes
    MutableTyperStateTyperState
  8. def constraint_=(c: Constraint)(implicit ctx: Context): Unit

    Definition Classes
    MutableTyperStateTyperState
  9. def ephemeral: Boolean

    The ephemeral flag is set as a side effect if an operation accesses the underlying type of a type variable.

    The ephemeral flag is set as a side effect if an operation accesses the underlying type of a type variable. The reason we need this flag is that any such operation is not referentially transparent; it might logically change its value at the moment the type variable is instantiated. Caching code needs to check the ephemeral flag; If the flag is set during an operation, the result of that operation should not be cached.

    Definition Classes
    MutableTyperStateTyperState
  10. def ephemeral_=(x: Boolean): Unit

    Definition Classes
    MutableTyperStateTyperState
  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def fallbackToText(printer: Printer): Text

    A fallback text representation, if the pattern matching in Printers does not have a case for this showable element

    A fallback text representation, if the pattern matching in Printers does not have a case for this showable element

    Definition Classes
    Showable
  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def fresh(isCommittable: Boolean): TyperState

    A fresh typer state with the same constraint as this one.

    A fresh typer state with the same constraint as this one.

    isCommittable

    The constraint can be committed to an enclosing context.

    Definition Classes
    MutableTyperStateTyperState
  16. def gc()(implicit ctx: Context): Unit

    Make type variable instances permanent by assigning to inst field if type variable instantiation cannot be retracted anymore.

    Make type variable instances permanent by assigning to inst field if type variable instantiation cannot be retracted anymore. Then, remove no-longer needed constraint entries.

    Definition Classes
    MutableTyperStateTyperState
  17. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  19. def instType(tvar: TypeVar)(implicit ctx: Context): Type

    Gives for each instantiated type var that does not yet have its inst field set, the instance value stored in the constraint.

    Gives for each instantiated type var that does not yet have its inst field set, the instance value stored in the constraint. Storing instances in constraints is done only in a temporary way for contexts that may be retracted without also retracting the type var as a whole.

    Definition Classes
    TyperState
  20. val isCommittable: Boolean

    Is it allowed to commit this state?

    Is it allowed to commit this state?

    Definition Classes
    MutableTyperStateTyperState
  21. val isGlobalCommittable: Boolean

    Can this state be transitively committed until the top-level?

    Can this state be transitively committed until the top-level?

    Definition Classes
    MutableTyperStateTyperState
  22. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. final def notify(): Unit

    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  26. def reporter: Reporter

    The current reporter

    The current reporter

    Definition Classes
    MutableTyperStateTyperState
  27. def show(implicit ctx: Context): String

    The string representation of this showable element.

    The string representation of this showable element.

    Definition Classes
    Showable
  28. def showSummary(implicit ctx: Context): String

    Definition Classes
    Showable
  29. def showSummary(depth: Int)(implicit ctx: Context): String

    The summarized string representation of this showable element.

    The summarized string representation of this showable element. Recursion depth is limited to some smallish value. Default is Config.summarizeDepth.

    Definition Classes
    Showable
  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  31. def toString(): String

    Definition Classes
    AnyRef → Any
  32. def toText(printer: Printer): Text

    The text representation of this showable element.

    The text representation of this showable element. This normally dispatches to a pattern matching method in Printers.

    Definition Classes
    MutableTyperStateTyperStateShowable
  33. def tryWithFallback[T](op: ⇒ T)(fallback: ⇒ T)(implicit ctx: Context): T

    Try operation op; if it produces errors, execute fallback with constraint and reporter as they were before op was executed.

    Try operation op; if it produces errors, execute fallback with constraint and reporter as they were before op was executed. This is similar to typer/tryEither, but with one important difference: Any type variable instantiations produced by op are persisted even if op fails. This is normally not what one wants and therefore it is recommended to use

    tryEither { implicit ctx => op } { (_, _) => fallBack }

    instead of

    ctx.tryWithFallback(op)(fallBack)

    tryWithFallback is only used when an implicit parameter search fails and the whole expression is subsequently retype-checked with a Wildcard expected type (so as to allow an implicit conversion on the result and avoid over-constraining the implicit parameter search). In this case, the only type variables that might be falsely instantiated by op but not by fallBack are type variables in the typed expression itself, and these will be thrown away and new ones will be created on re-typing. So tryWithFallback is safe. It is also necessary because without it we do not propagate enough instantiation information into the implicit search and this might lead to a missing parameter type error. This is exhibited at several places in the test suite (for instance in pos_typers). Overall, this is rather ugly, but despite trying for 2 days I have not found a better solution.

    Definition Classes
    MutableTyperStateTyperState
  34. def uncommittedAncestor: TyperState

    The closest ancestor of this typer state (including possibly this typer state itself) which is not yet committed, or which does not have a parent.

    The closest ancestor of this typer state (including possibly this typer state itself) which is not yet committed, or which does not have a parent.

    Definition Classes
    MutableTyperStateTyperState
  35. def uninstVars: Seq[TypeVar]

    The uninstantiated variables

    The uninstantiated variables

    Definition Classes
    TyperState
  36. def unsupported(methodName: String): Nothing

    Throws an UnsupportedOperationException with the given method name.

    Throws an UnsupportedOperationException with the given method name.

    Definition Classes
    DotClass
  37. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. def withReporter(reporter: Reporter): MutableTyperState

    A fresh type state with the same constraint as this one and the given reporter

    A fresh type state with the same constraint as this one and the given reporter

    Definition Classes
    MutableTyperStateTyperState

Inherited from TyperState

Inherited from Showable

Inherited from DotClass

Inherited from AnyRef

Inherited from Any

Ungrouped