File tree Expand file tree Collapse file tree 2 files changed +29
-5
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +29
-5
lines changed Original file line number Diff line number Diff line change @@ -925,11 +925,14 @@ object SymDenotations {
925925 /** The top-level class containing this denotation,
926926 * except for a toplevel module, where its module class is returned.
927927 */
928- final def topLevelClass (implicit ctx : Context ): Symbol = {
929- def topLevel (d : SymDenotation ): Symbol = {
930- if (d.isEffectiveRoot || (d is PackageClass ) || (d.owner is PackageClass )) d.symbol
931- else topLevel(d.owner)
932- }
928+ def topLevelClass (implicit ctx : Context ): Symbol = {
929+
930+ def topLevel (d : SymDenotation ): Symbol =
931+ if (! exists || d.isEffectiveRoot || (d is PackageClass ) || (d.owner is PackageClass ))
932+ d.symbol
933+ else
934+ topLevel(d.owner)
935+
933936 val sym = topLevel(this )
934937 if (sym.isClass) sym else sym.moduleClass
935938 }
Original file line number Diff line number Diff line change 1+ object App {
2+ def main (args : Array [String ]): Unit = {
3+ trait FooT {
4+ type T
5+ type Bar [A ]
6+
7+ def get (k : Bar [T ]): String
8+ }
9+ val test : FooT = new FooT {
10+ type T = String
11+ type Bar [A ] = J [A ]
12+ sealed abstract class J [A ]
13+ final case object JName extends J [T ]
14+ final case object JInt extends J [Int ]
15+
16+ def get (k : J [T ]): String = k match {
17+ case JName => " Age"
18+ }
19+ }
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments