File tree 3 files changed +23
-0
lines changed
compiler/src/dotty/tools/dotc/printing
3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -572,6 +572,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
572
572
case tree : TypeTree =>
573
573
typeText(toText(tree.typeOpt))
574
574
~ Str (" (inf)" ).provided(tree.isInferred && printDebug)
575
+ case SingletonTypeTree (ref : Literal ) => toTextLocal(ref)
575
576
case SingletonTypeTree (ref) =>
576
577
toTextLocal(ref) ~ " ." ~ keywordStr(" type" )
577
578
case RefinedTypeTree (tpt, refines) =>
Original file line number Diff line number Diff line change
1
+ [[syntax trees at end of typer]] // tests/printing/i22349.scala
2
+ package <empty> {
3
+ final lazy module val i22349$package: i22349$package = new i22349$package()
4
+ final module class i22349$package() extends Object() {
5
+ this: i22349$package.type =>
6
+ val x: Int = 0
7
+ val _$1: x.type = x
8
+ inline val _$2: true = true
9
+ inline val _$3: "abc" = "abc"
10
+ inline val _$4: 'c' = 'c'
11
+ inline val _$5: 1.2f = 1.2f
12
+ inline val _$6: 1.2d = 1.2d
13
+ }
14
+ }
15
+
Original file line number Diff line number Diff line change
1
+ val x = 0
2
+ val _: x.type = x
3
+ inline val _: true = true // boolean literal
4
+ inline val _: " abc" = " abc" // string literal
5
+ inline val _: 'c' = 'c' // character literal
6
+ inline val _: 1.2f = 1.2f // floating point literal
7
+ inline val _: 1.2d = 1.2d // double number literal
You can’t perform that action at this time.
0 commit comments