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.
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 does not compile:
object Test { type Result[A] = Errors | A final case class Errors(msgs: Seq[String]) implicit class RichRes[A](val res: Result[A]) extends AnyVal { def map[B](f: A => B): Result[B] = res match { case xs: Errors => xs case a: A => f(a) } } val foo: Result[String] = ??? def f(str: String): Int = ??? foo.map(f(_)) // error }
[error] -- [E007] Type Mismatch Error: /Users/fixel/Projects/dotty/repl/src/dotty/tools/repl/Repl.scala:67:13 [error] 67 | x1.map(f(_)) [error] | ^ [error] |found: (dotty.tools.repl.results.Errors | dotty.tools.repl.ReplTyper.Success)(_$1) [error] |required: dotty.tools.repl.ReplTyper.Success [error] | [error] one error found [error] (dotty-repl/compile:compileIncremental) Compilation failed
ping @odersky
The text was updated successfully, but these errors were encountered:
That would actually be a show-stopper for Scala.js to use type js.UndefOr[+A] = A | js.Undefined, which is something we'd like to do.
type js.UndefOr[+A] = A | js.Undefined
Sorry, something went wrong.
15d6823
Merge pull request #2746 from dotty-staging/fix-#2745
243e439
Fix #2745: Dealias before either
No branches or pull requests
The following does not compile:
ping @odersky
The text was updated successfully, but these errors were encountered: