diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala index 2c3d2f9259a4..145913261053 100644 --- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala @@ -1646,13 +1646,11 @@ object SymDenotations { case tp @ AppliedType(tycon, args) => val subsym = tycon.typeSymbol if (subsym eq symbol) tp - else subsym.denot match { - case clsd: ClassDenotation => - val tparams = clsd.typeParams - if (tparams.hasSameLengthAs(args)) baseTypeOf(tycon).subst(tparams, args) - else NoType - case _ => + else tycon.typeParams match { + case LambdaParam(_, _) :: _ => baseTypeOf(tp.superType) + case tparams: List[Symbol @unchecked] => + baseTypeOf(tycon).subst(tparams, args) } case tp: TypeProxy => baseTypeOf(tp.superType) diff --git a/tests/pos/i3343.scala b/tests/pos/i3343.scala new file mode 100644 index 000000000000..15f1d88922ef --- /dev/null +++ b/tests/pos/i3343.scala @@ -0,0 +1,5 @@ +object Test { + def foo[C[_]](implicit t: C[Char] => Traversable[Char]): C[Char] = ??? + + val a: List[Char] = foo +}