File tree Expand file tree Collapse file tree 3 files changed +33
-1
lines changed
library/src/scala/tasty/util Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,8 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
128
128
case _ => false
129
129
})
130
130
}
131
- ! flags.isParam && ! flags.isParamAccessor && ! isCaseClassUnOverridableMethod
131
+ def isInnerModuleObject = d.flags.isLazy && d.flags.isObject
132
+ ! flags.isParam && ! flags.isParamAccessor && ! isCaseClassUnOverridableMethod && ! isInnerModuleObject
132
133
}
133
134
val stats1 = stats.collect {
134
135
case stat@ Definition () if keepDefinition(stat) => stat
@@ -623,6 +624,10 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
623
624
624
625
case TypeTree .Singleton (ref) =>
625
626
printTree(ref)
627
+ ref match {
628
+ case Term .Literal (_) => this
629
+ case _ => this += " .type"
630
+ }
626
631
627
632
case TypeTree .Refined (tpt, refinements) =>
628
633
printTypeTree(tpt)
Original file line number Diff line number Diff line change
1
+ /** Decompiled from out/posTestFromTasty/pos/simpleSingleton/Foo.class */
2
+ class Foo() {
3
+ def foo(x: scala.Int): scala.Unit = {
4
+ val a: x.type = x
5
+ val b: Foo.type = Foo
6
+ val c: Foo.Bar.type = Foo.Bar
7
+ val d: 1 = 1
8
+ val e: "abc" = "abc"
9
+ ()
10
+ }
11
+ }
12
+ object Foo {
13
+ object Bar
14
+ }
Original file line number Diff line number Diff line change
1
+ class Foo {
2
+ def foo (x : Int ) = {
3
+ val a : x.type = x
4
+ val b : Foo .type = Foo
5
+ val c : Foo .Bar .type = Foo .Bar
6
+ val d : 1 = 1
7
+ val e : " abc" = " abc"
8
+ }
9
+ }
10
+
11
+ object Foo {
12
+ object Bar
13
+ }
You can’t perform that action at this time.
0 commit comments