Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ object ProtoTypes {
override def isMatchedBy(tp: Type, keepConstraint: Boolean)(using Context): Boolean =
canInstantiate(tp) || tp.member(nme.apply).hasAltWith(d => canInstantiate(d.info))

def derivedPolyProto(targs: List[Tree], resultType: Type): PolyProto =
def derivedPolyProto(targs: List[Tree], resType: Type): PolyProto =
if ((targs eq this.targs) && (resType eq this.resType)) this
else PolyProto(targs, resType)

Expand Down
4 changes: 4 additions & 0 deletions tests/neg/i14145.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
val l: List[Option[Int]] = List(None, Some(1), None)

@main def m15 =
l.collectFirst(Some.unapply.unlift[Option[Int], Int]) // error