Skip to content
Closed
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/Applications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,7 @@ trait Applications extends Compatibility {
val newAcc =
params match
case param :: _ if param.isType => true
case param :: _ if param.isTerm && !param.isOneOf(GivenOrImplicit) => false
case param :: _ if param.isTerm && !param.is(Given) => false
case _ => acc
hasTrailingTypeParams(paramss.tail, newAcc)

Expand Down
18 changes: 18 additions & 0 deletions tests/pos/i23499.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
def summonsTest =
given Type[String] = ???
val opt1: Option[Wrapper[String]] = Wrapper.unapply[String] // ok
val opt2 = Wrapper.unapply[String]
opt2.map(_.getValue)

def patternMatchTest =
Type[String] match
case Wrapper(v) => v.getValue // was an error

type Type[A] = Class[A] // any rhs would work here
object Type:
def apply[A]: Type[A] = ???

trait Wrapper[T]:
def getValue: T = ???
object Wrapper:
def unapply[T](implicit ev: Type[T]): Option[Wrapper[T]] = None
Loading