We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following doesn't compile:
type Dummy[A] = A implicit def dummy[A]: Dummy[A] = null.asInstanceOf[A] def m(x: List[String])(implicit d: Dummy[String]) = "string" def m(x: List[Int])(implicit d: Dummy[Int]) = "int" m(List(1, 2, 3)) m(List("a"))
But if we inline the type alias,
type Dummy[A] = A implicit def dummy[A]: Dummy[A] = null.asInstanceOf[A] def m(x: List[String])(implicit d: String) = "string" def m(x: List[Int])(implicit d: Int) = "int" m(List(1, 2, 3)) m(List("a"))
everything works as expected.
The text was updated successfully, but these errors were encountered:
Thanks for reporting! I could minimize it further without implicits:
type Dummy[A] = A def m(d: Dummy[String]) = () def m(d: Dummy[Int]) = ()
4 | def m(d: Dummy[Int]) = () | ^ | method m is already defined as method m: (d: O.Dummy[String])Unit | (the definitions have matching type signatures)
Sorry, something went wrong.
Merge pull request #2236 from dotty-staging/fix-#2234
6a0c581
Fix #2234: Dealias before type erasing
No branches or pull requests
The following doesn't compile:
But if we inline the type alias,
everything works as expected.
The text was updated successfully, but these errors were encountered: