File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
compiler/src/dotty/tools/dotc/transform
tests/neg-custom-args/fatal-warnings Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,12 @@ class CheckUnused extends MiniPhase:
8181 ctx
8282
8383 override def prepareForIdent (tree : tpd.Ident )(using Context ): Context =
84- _key.unusedDataApply(_.registerUsed(tree.symbol, Some (tree.name)))
84+ if tree.symbol.exists then
85+ _key.unusedDataApply(_.registerUsed(tree.symbol, Some (tree.name)))
86+ else if tree.hasType then
87+ _key.unusedDataApply(_.registerUsed(tree.tpe.classSymbol, Some (tree.name)))
88+ else
89+ ctx
8590
8691 override def prepareForSelect (tree : tpd.Select )(using Context ): Context =
8792 _key.unusedDataApply(_.registerUsed(tree.symbol, Some (tree.name)))
Original file line number Diff line number Diff line change @@ -255,4 +255,14 @@ package foo.testing.imports.precedence:
255255package foo .test .enums:
256256 enum A : // OK
257257 case B extends A // OK
258- case C extends A // OK
258+ case C extends A // OK
259+
260+ package foo .test .typeapply .hklamdba .i16680:
261+ package foo:
262+ trait IO [A ]
263+
264+ package bar:
265+ import foo .IO // OK
266+
267+ def f [F [_]]: String = " hello"
268+ def go = f[IO ]
You can’t perform that action at this time.
0 commit comments