diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index b3629dc2386b..6b497c0b495e 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -4728,6 +4728,8 @@ object Types { zeroParamClass(tp.underlying) case tp: TypeVar => zeroParamClass(tp.underlying) + case tp: AnnotatedType => + zeroParamClass(tp.underlying) case _ => NoType } diff --git a/tests/pos/i8845.scala b/tests/pos/i8845.scala new file mode 100644 index 000000000000..52e41cbc9605 --- /dev/null +++ b/tests/pos/i8845.scala @@ -0,0 +1,8 @@ +trait IntToLong: + def apply(v: Int) : Long + +inline def convert1( f: IntToLong) = ??? +inline def convert2(inline f: IntToLong) = ??? + +val test1 = convert1(_ * 10) +val test2 = convert2(_ * 10)