File tree 2 files changed +22
-3
lines changed
compiler/src/dotty/tools/dotc/transform
tests/neg-custom-args/fatal-warnings
2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ class CheckUnused extends MiniPhase:
59
59
// ========== SETUP ============
60
60
61
61
override def prepareForUnit (tree : tpd.Tree )(using Context ): Context =
62
- println(tree)
63
62
val data = UnusedData ()
64
63
val fresh = ctx.fresh.setProperty(_key, data)
65
64
fresh
@@ -76,7 +75,7 @@ class CheckUnused extends MiniPhase:
76
75
traverser.traverse(tree)
77
76
ctx
78
77
79
- def prepareForInlined (tree : Inlined )(using Context ): Context =
78
+ override def prepareForInlined (tree : tpd. Inlined )(using Context ): Context =
80
79
traverser.traverse(tree.call)
81
80
ctx
82
81
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ package foo.test.i16925:
166
166
_ = println(i) // OK
167
167
} yield ()
168
168
169
- package foo .test .i16679 :
169
+ package foo .test .i16679a :
170
170
object myPackage :
171
171
trait CaseClassName [A ]:
172
172
def name : String
@@ -182,3 +182,23 @@ package foo.test.i16679:
182
182
import myPackage .CaseClassName // OK
183
183
case class CoolClass (i : Int ) derives CaseClassName .CaseClassByStringName
184
184
println(summon[CaseClassName [CoolClass ]].name)
185
+
186
+ package foo .test .i16679b:
187
+ object myPackage :
188
+ trait CaseClassName [A ]:
189
+ def name : String
190
+
191
+ object CaseClassName :
192
+ import scala .deriving .Mirror
193
+ inline final def derived [A ](using inline A : Mirror .Of [A ]): CaseClassName [A ] =
194
+ new CaseClassName [A ]:
195
+ def name : String = A .toString
196
+
197
+ object Foo :
198
+ given x : myPackage.CaseClassName [secondPackage.CoolClass ] = null
199
+
200
+ object secondPackage :
201
+ import myPackage .CaseClassName // OK
202
+ import Foo .x
203
+ case class CoolClass (i : Int )
204
+ println(summon[myPackage.CaseClassName [CoolClass ]])
You can’t perform that action at this time.
0 commit comments