Differences between Scalac and Dotty

Overview explanation how symbols, named types and denotations hang together: Denotations1

Denotation

Comment with a few details: Denotations2

A Denotation is the result of a name lookup during a given period

Denotations of methods have a signature (Signature1), which uniquely identifies overloaded methods.

Denotation vs. SymDenotation

A SymDenotation is an extended denotation that has symbol-specific properties (that may change over phases) * flags * annotations * info

SymDenotation implements lazy types (similar to scalac). The type completer assigns the denotation's info.

Implicit Conversion

There is an implicit conversion:

core.Symbols.toDenot(sym: Symbol)(implicit ctx: Context): SymDenotation

Because the class Symbol is defined in the object core.Symbols, the implicit conversion does not need to be imported, it is part of the implicit scope of the type Symbol (check the Scala spec). However, it can only be applied if an implicit Context is in scope.

Symbol

Most of the isFooBar properties in scalac don't exist anymore in dotc. Use flag tests instead, for example:

if (sym.isPackageClass)         // scalac
if (sym is Flags.PackageClass)  // dotc (*)

(*) Symbols are implicitly converted to their denotation, see above. Each SymDenotation has flags that can be queried using the is method.

Flags

000..0001000..01
        ^     ^^
        flag  | \
              |  valid for term
              valid for type

Tree

Type

@todo