File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1738,8 +1738,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
1738
1738
// Replace the underspecified expected type by one based on the closure method type
1739
1739
defn.PartialFunctionOf (mt.firstParamTypes.head, mt.resultType)
1740
1740
else
1741
- report.error(em " result type of lambda is an underspecified SAM type $samParent" , tree.srcPos)
1742
- samParent
1741
+ errorType(em " result type of lambda is an underspecified SAM type $samParent" , tree.srcPos)
1743
1742
TypeTree (targetTpe)
1744
1743
case _ =>
1745
1744
if (mt.isParamDependent)
Original file line number Diff line number Diff line change
1
+ trait SAMFunction1 [- T1 , + R ]:
2
+ def apply (x1 : T1 ): R
3
+
4
+ def fooSAM [T ](foo : SAMFunction1 [T , T ] = (f : T ) => f): Unit = () // error
You can’t perform that action at this time.
0 commit comments