Skip to content

Fix #11481: Count signature names as consistent if one of them is a wildcard #12033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
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
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/core/Signature.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ case class Signature(paramsSig: List[ParamSig], resSig: TypeName) {

/** Two names are consistent if they are the same or one of them is tpnme.Uninstantiated */
private def consistent(name1: ParamSig, name2: ParamSig) =
name1 == name2 || name1 == tpnme.Uninstantiated || name2 == tpnme.Uninstantiated
name1 == name2 || name1 == tpnme.Uninstantiated || name2 == tpnme.Uninstantiated ||
name1 == tpnme.WILDCARD || name2 == tpnme.WILDCARD

/** Does this signature coincide with that signature on their parameter parts?
* This is the case if all parameter signatures are _consistent_, i.e. they are either
Expand Down
1 change: 1 addition & 0 deletions tests/pos/i11481a.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
case class Baz[F[_]](f: {def f(x: F[Int]): Object})
1 change: 1 addition & 0 deletions tests/pos/i11481b.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
case class Baz[F[_], G[_]](f: [B] => F[B] => G[B])