diff --git a/library/src/scala/tasty/reflect/SourceCodePrinter.scala b/library/src/scala/tasty/reflect/SourceCodePrinter.scala index aca2e76e1dc8..cc2b8ad1114a 100644 --- a/library/src/scala/tasty/reflect/SourceCodePrinter.scala +++ b/library/src/scala/tasty/reflect/SourceCodePrinter.scala @@ -1055,7 +1055,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig printType(lo) this += " <: " printType(hi) - case IsType(tpe) => printType(tpe) + case tpe: Type => printType(tpe) } /** Print type @@ -1089,7 +1089,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig this += "#" case ThisType(TermRef(cdef, _)) if elideThis.nonEmpty && cdef == elideThis.get => case ThisType(TypeRef(cdef, _)) if elideThis.nonEmpty && cdef == elideThis.get => - case IsType(prefix) => + case prefix: Type => printType(prefix) this += "." } @@ -1266,7 +1266,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig case ByNameType(t) => this += ": " printType(t) - case IsType(tp) => + case tp: Type => this += ": " printType(tp) } @@ -1282,7 +1282,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig case ByNameType(_) | MethodType(_, _, _) | TypeLambda(_, _, _) => this += highlightKeyword("def ") += highlightTypeDef(name) printMethodicType(info) - case IsType(info) => + case info: Type => this += highlightKeyword("val ") += highlightValDef(name) printMethodicType(info) } @@ -1298,7 +1298,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig def printMethodicTypeParams(paramNames: List[String], params: List[TypeOrBounds])(given elideThis: Option[Symbol]): Unit = { def printInfo(info: TypeOrBounds) = info match { case info: TypeBounds => printBounds(info) - case IsType(info) => + case info: Type => this += ": " printType(info) } @@ -1444,8 +1444,8 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig object Sequence { def unapply(tpe: Type)(given ctx: Context): Option[Type] = tpe match { - case AppliedType(TypeRef(prefix: TermRef, "Seq"), IsType(tp) :: Nil) if prefix.termSymbol.fullName == "scala.collection" => Some(tp) - case AppliedType(TypeRef(prefix: TypeRef, "Seq"), IsType(tp) :: Nil) if prefix.typeSymbol.fullName == "scala.collection" => Some(tp) + case AppliedType(TypeRef(prefix: TermRef, "Seq"), (tp: Type) :: Nil) if prefix.termSymbol.fullName == "scala.collection" => Some(tp) + case AppliedType(TypeRef(prefix: TypeRef, "Seq"), (tp: Type) :: Nil) if prefix.typeSymbol.fullName == "scala.collection" => Some(tp) case _ => None } } @@ -1460,7 +1460,7 @@ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlig object Repeated { def unapply(tpe: Type)(given ctx: Context): Option[Type] = tpe match { - case AppliedType(TypeRef(ScalaPackage(), ""), IsType(tp) :: Nil) => Some(tp) + case AppliedType(TypeRef(ScalaPackage(), ""), (tp: Type) :: Nil) => Some(tp) case _ => None } } diff --git a/library/src/scala/tasty/reflect/TypeOrBoundsOps.scala b/library/src/scala/tasty/reflect/TypeOrBoundsOps.scala index 995cbce8b85c..54ae96e1e2b3 100644 --- a/library/src/scala/tasty/reflect/TypeOrBoundsOps.scala +++ b/library/src/scala/tasty/reflect/TypeOrBoundsOps.scala @@ -63,13 +63,11 @@ trait TypeOrBoundsOps extends Core { def isDependentFunctionType(given ctx: Context): Boolean = internal.Type_isDependentFunctionType(self) } - // FIXME: needs #7532 fixed in the reference compiler - // given (given Context): IsInstanceOf[Type] = internal.isInstanceOfType + given (given Context): IsInstanceOf[Type] = internal.isInstanceOfType object IsType - // FIXME: Add depecation. Needs #7532 fixed in the reference compiler - // @deprecated("Use _: Type", "") - def unapply(x: TypeOrBounds)(given ctx: Context): Option[Type] = + @deprecated("Use _: Type", "") + def unapply(x: Type)(given ctx: Context): Option[Type] = internal.isInstanceOfType.unapply(x) object Type { diff --git a/project/Build.scala b/project/Build.scala index 9c4b29bffdce..cc248d8655b8 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -58,7 +58,7 @@ object MyScalaJSPlugin extends AutoPlugin { } object Build { - val referenceVersion = "0.20.0-RC1" + val referenceVersion = "0.21.0-bin-20191119-7c7fffa-NIGHTLY" val baseVersion = "0.21.0" val baseSbtDottyVersion = "0.3.5" diff --git a/tests/run-macros/tasty-simplified/quoted_1.scala b/tests/run-macros/tasty-simplified/quoted_1.scala index e792437845d8..1c382f252b8a 100644 --- a/tests/run-macros/tasty-simplified/quoted_1.scala +++ b/tests/run-macros/tasty-simplified/quoted_1.scala @@ -11,7 +11,7 @@ object Macros { def unpackTuple(tp: Type): List[Type] = { @tailrec def loop(tp: Type, acc: List[Type]): List[Type] = tp.dealias.simplified match { - case AppliedType(_, List(IsType(hd), IsType(tl))) => + case AppliedType(_, List(hd: Type, tl: Type)) => loop(tl, hd.dealias.simplified :: acc) case other => acc }