dotty.tools.dotc.typer.Dynamic
See theDynamic companion object
trait Dynamic
Handles programmable member selections of Dynamic
instances and values
with structural types. Two functionalities:
- Translates selection that does not typecheck according to the scala.Dynamic rules: foo.bar(baz) = quux ~~> foo.selectDynamic(bar).update(baz, quux) foo.bar = baz ~~> foo.updateDynamic("bar")(baz) foo.bar(x = bazX, y = bazY, baz, ...) ~~> foo.applyDynamicNamed("bar")(("x", bazX), ("y", bazY), ("", baz), ...) foo.bar(baz0, baz1, ...) ~~> foo.applyDynamic(bar)(baz0, baz1, ...) foo.bar ~~> foo.selectDynamic(bar)
The first matching rule of is applied.
- Translates member selections on structural types to calls of
selectDynamic
orapplyDynamic
on aSelectable
instance. @See handleStructural.
Attributes
- Companion:
- object
- Graph
- Supertypes
- Known subtypes
- Self type