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.
2 parents 0b55c7d + 209b18e commit de42a98Copy full SHA for de42a98
compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala
@@ -582,7 +582,7 @@ object ProtoTypes {
582
override def isMatchedBy(tp: Type, keepConstraint: Boolean)(using Context): Boolean =
583
canInstantiate(tp) || tp.member(nme.apply).hasAltWith(d => canInstantiate(d.info))
584
585
- def derivedPolyProto(targs: List[Tree], resultType: Type): PolyProto =
+ def derivedPolyProto(targs: List[Tree], resType: Type): PolyProto =
586
if ((targs eq this.targs) && (resType eq this.resType)) this
587
else PolyProto(targs, resType)
588
tests/neg/i14145.scala
@@ -0,0 +1,4 @@
1
+val l: List[Option[Int]] = List(None, Some(1), None)
2
+
3
+@main def m15 =
4
+ l.collectFirst(Some.unapply.unlift[Option[Int], Int]) // error
0 commit comments