File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
compiler/src/dotty/tools/dotc/transform
tests/neg-custom-args/fatal-warnings Expand file tree Collapse file tree 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:
5959 // ========== SETUP ============
6060
6161 override def prepareForUnit (tree : tpd.Tree )(using Context ): Context =
62- println(tree)
6362 val data = UnusedData ()
6463 val fresh = ctx.fresh.setProperty(_key, data)
6564 fresh
@@ -76,7 +75,7 @@ class CheckUnused extends MiniPhase:
7675 traverser.traverse(tree)
7776 ctx
7877
79- def prepareForInlined (tree : Inlined )(using Context ): Context =
78+ override def prepareForInlined (tree : tpd. Inlined )(using Context ): Context =
8079 traverser.traverse(tree.call)
8180 ctx
8281
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ package foo.test.i16925:
209209 _ = println(i) // OK
210210 } yield ()
211211
212- package foo .test .i16679 :
212+ package foo .test .i16679a :
213213 object myPackage :
214214 trait CaseClassName [A ]:
215215 def name : String
@@ -225,3 +225,23 @@ package foo.test.i16679:
225225 import myPackage .CaseClassName // OK
226226 case class CoolClass (i : Int ) derives CaseClassName .CaseClassByStringName
227227 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