diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 8a08be37b7bb..da66c5b622b5 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -1475,8 +1475,7 @@ class Typer extends Namer */ def maybeCall(ref: Tree, psym: Symbol, cinfo: Type): Tree = cinfo.stripPoly match { case cinfo @ MethodType(Nil) if cinfo.resultType.isImplicitMethod => - val icall = New(ref).select(nme.CONSTRUCTOR).appliedToNone - typedExpr(untpd.TypedSplice(icall))(superCtx) + typedExpr(untpd.New(ref, Nil))(superCtx) case cinfo @ MethodType(Nil) if !cinfo.resultType.isInstanceOf[MethodType] => ref case cinfo: MethodType => diff --git a/tests/pos/i4582.scala b/tests/pos/i4582.scala new file mode 100644 index 000000000000..1f605b8cd9f1 --- /dev/null +++ b/tests/pos/i4582.scala @@ -0,0 +1,6 @@ +trait T[A: Numeric] +class TX[A: Numeric] extends T[A] +class TY[A: Numeric] extends T[A]() + +trait S[A: Numeric](x: Int) +class SX[A: Numeric] extends S[A](0)