Scalameta 1.3.0
Tokens
- Some additional operations on
Tokens
now returnTokens
instead of a sequence of tokens (details).
Trees
-
Type.Compound has been split into
Type.With
andType.Refine
in order to provide common ground for compatibility with Dotty. Dotty gets rid ofwith
in favor of intersection types, but it still has type refinements, so we needed to extractType.Refine
, so that it can be used in both dialects.scala> t"A with B".structure res0: String = Type.With(Type.Name("A"), Type.Name("B")) scala> t"{ def x: Int }".structure res1: String = Type.Refine(None, Seq(Decl.Def(Nil, Term.Name("x"), Nil, Nil, Type.Name("Int")))) scala> t"A { def x: Int }".structure res2: String = Type.Refine(Some(Type.Name("A")), Seq(Decl.Def(Nil, Term.Name("x"), Nil, Nil, Type.Name("Int")))) scala> t"A with B { def x: Int }".structure res3: String = Type.Refine(Some(Type.With(Type.Name("A"), Type.Name("B"))), Seq(Decl.Def(Nil, Term.Name("x"), Nil, Nil, Type.Name("Int"))))
-
Pat.Type.And
andPat.Type.Or
have been introduced to provide analogs ofType.And
andType.Or
for pattern types. Not including them in 1.2.0 was an oversight, which is now fixed. -
Some fields in AST nodes have been renamed in order to streamline naming:
Term.Ascribe.decltpe
=>Term.Ascribe.tpe
Term/Pat/Type.Tuple.elements
=>Term/Pat/Type.Tuple.args
Term.Match.scrut
=>Term.Match.expr
Term.Eta.term
=>Term.Eta.expr
Term.Named.rhs
=>Term.Named.expr
Term.Repeated.arg
=>Term.Repeated.expr
Type.Existential.quants
=>Type.Existential.stats
Pat.ExtractInfix.ref
=>Pat.ExtractInfix.op
Dotty support
A with B
is now parsed asA & B
in accordance with the behavior of the Dotty parser.Type.And
andType.Or
can no longer be prettyprinted inScalaXXX
and derived dialects.Type.With
can no longer be prettyprinted inDotty
and derived dialects.