File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -1501,7 +1501,7 @@ class Typer extends Namer
15011501 */
15021502 def maybeCall (ref : Tree , psym : Symbol , cinfo : Type ): Tree = cinfo.stripPoly match {
15031503 case cinfo @ MethodType (Nil ) if cinfo.resultType.isImplicitMethod =>
1504- typedExpr(untpd.New (ref, Nil ))(superCtx)
1504+ typedExpr(untpd.New (untpd. TypedSplice ( ref)(superCtx) , Nil ))(superCtx)
15051505 case cinfo @ MethodType (Nil ) if ! cinfo.resultType.isInstanceOf [MethodType ] =>
15061506 ref
15071507 case cinfo : MethodType =>
@@ -1518,7 +1518,7 @@ class Typer extends Namer
15181518
15191519 def typedParent (tree : untpd.Tree ): Tree = {
15201520 var result = if (tree.isType) typedType(tree)(superCtx) else typedExpr(tree)(superCtx)
1521- val psym = result.tpe.typeSymbol
1521+ val psym = result.tpe.dealias. typeSymbol
15221522 if (seenParents.contains(psym) && ! cls.isRefinementClass)
15231523 ctx.error(i " $psym is extended twice " , tree.pos)
15241524 seenParents += psym
Original file line number Diff line number Diff line change 1+ trait T (x : Int )
2+
3+ class C {
4+ type Foo [X ] = T
5+ class D extends Foo [Unit ] // error
6+ }
Original file line number Diff line number Diff line change 1+ trait T [X : Numeric ]
2+
3+ class C {
4+ type S [X ] = T [X ]
5+ type Foo [X , Y ] = T [X ]
6+ type Bar [X , Y ] = Foo [X , Y ]
7+
8+ class D [X : Numeric ] extends S [X ]
9+ class E [X : Numeric ] extends Foo [X , Unit ]
10+ class F [X : Numeric ] extends Bar [X , Unit ]
11+ }
You can’t perform that action at this time.
0 commit comments