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 @@ -209,7 +209,7 @@ package foo.test.i16925:
209
209
_ = println(i) // OK
210
210
} yield ()
211
211
212
- package foo .test .i16679 :
212
+ package foo .test .i16679a :
213
213
object myPackage :
214
214
trait CaseClassName [A ]:
215
215
def name : String
@@ -225,3 +225,23 @@ package foo.test.i16679:
225
225
import myPackage .CaseClassName // OK
226
226
case class CoolClass (i : Int ) derives CaseClassName .CaseClassByStringName
227
227
println(summon[CaseClassName [CoolClass ]].name)
228
+
229
+ package foo .test .i16679b:
230
+ object myPackage :
231
+ trait CaseClassName [A ]:
232
+ def name : String
233
+
234
+ object CaseClassName :
235
+ import scala .deriving .Mirror
236
+ inline final def derived [A ](using inline A : Mirror .Of [A ]): CaseClassName [A ] =
237
+ new CaseClassName [A ]:
238
+ def name : String = A .toString
239
+
240
+ object Foo :
241
+ given x : myPackage.CaseClassName [secondPackage.CoolClass ] = null
242
+
243
+ object secondPackage :
244
+ import myPackage .CaseClassName // OK
245
+ import Foo .x
246
+ case class CoolClass (i : Int )
247
+ println(summon[myPackage.CaseClassName [CoolClass ]])
You can’t perform that action at this time.
0 commit comments