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
1501
1501
*/
1502
1502
def maybeCall (ref : Tree , psym : Symbol , cinfo : Type ): Tree = cinfo.stripPoly match {
1503
1503
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)
1505
1505
case cinfo @ MethodType (Nil ) if ! cinfo.resultType.isInstanceOf [MethodType ] =>
1506
1506
ref
1507
1507
case cinfo : MethodType =>
@@ -1518,7 +1518,7 @@ class Typer extends Namer
1518
1518
1519
1519
def typedParent (tree : untpd.Tree ): Tree = {
1520
1520
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
1522
1522
if (seenParents.contains(psym) && ! cls.isRefinementClass)
1523
1523
ctx.error(i " $psym is extended twice " , tree.pos)
1524
1524
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