We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37bc11d commit 8ac74d5Copy full SHA for 8ac74d5
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -1170,7 +1170,7 @@ class Typer extends Namer
1170
if (tree.tpt.isEmpty)
1171
meth1.tpe.widen match {
1172
case mt: MethodType =>
1173
- pt match {
+ pt.stripAnnots match {
1174
case SAMType(sam)
1175
if !defn.isFunctionType(pt) && mt <:< sam =>
1176
// SAMs of the form C[?] where C is a class cannot be conversion targets.
tests/pos/i8845.scala
@@ -0,0 +1,8 @@
1
+trait IntToLong:
2
+ def apply(v: Int) : Long
3
+
4
+inline def convert1( f: IntToLong) = ???
5
+inline def convert2(inline f: IntToLong) = ???
6
7
+val test1 = convert1(_ * 10)
8
+val test2 = convert2(_ * 10)
0 commit comments