Skip to content

Commit faa3ef1

Browse files
Merge pull request #3879 from dotty-staging/fix-#3875
Fix #3875 and other details
2 parents 577781c + b37ca5e commit faa3ef1

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

compiler/src/dotty/tools/dotc/parsing/Scanners.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ object Scanners {
950950
setStrVal()
951951
} else {
952952
token = op
953-
strVal = name.toString
953+
strVal = if (name != null) name.toString else null
954954
litBuf.clear()
955955
}
956956
}

library/src/scala/quoted/Liftable.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ abstract class Liftable[T] {
1414
*/
1515
object Liftable {
1616

17-
final class ConstantExpr[T] private[Liftable](val value: T) extends Expr[T]
17+
final class ConstantExpr[T] private[Liftable](val value: T) extends Expr[T] {
18+
override def toString: String = s"Expr($value)"
19+
}
1820

1921
implicit def BooleanIsLiftable: Liftable[Boolean] = (x: Boolean) => new ConstantExpr(x)
2022
implicit def ByteLiftable: Liftable[Byte] = (x: Byte) => new ConstantExpr(x)

library/src/scala/quoted/TastyExpr.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import scala.runtime.quoted.Unpickler.Pickled
44

55
/** An Expr backed by a pickled TASTY tree */
66
final case class TastyExpr[T](tasty: Pickled, args: Seq[Any]) extends Expr[T] with TastyQuoted {
7-
override def toString(): String = s"TastyExpr(<TASTY>, $args)"
7+
override def toString(): String = s"Expr(<pickled>)"
88
}

library/src/scala/quoted/TastyType.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import scala.runtime.quoted.Unpickler.Pickled
44

55
/** A Type backed by a pickled TASTY tree */
66
final case class TastyType[T](tasty: Pickled, args: Seq[Any]) extends Type[T] with TastyQuoted {
7-
override def toString(): String = s"TastyType(<TASTY>, $args)"
7+
override def toString(): String = s"Type(<pickled>)"
88
}

library/src/scala/quoted/Type.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ abstract class Type[T] extends Quoted {
99
/** Some basic type tags, currently incomplete */
1010
object Type {
1111

12-
class TaggedPrimitive[T] private[Type] (implicit val ct: ClassTag[T]) extends Type[T]
12+
final class TaggedPrimitive[T] private[Type] (implicit val ct: ClassTag[T]) extends Type[T] {
13+
override def toString: String = s"Type($ct)"
14+
}
1315

1416
implicit def UnitTag: Type[Unit] = new TaggedPrimitive[Unit]
1517
implicit def BooleanTag: Type[Boolean] = new TaggedPrimitive[Boolean]

0 commit comments

Comments
 (0)