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
import scala.reflect.macros.WhiteboxContext import scala.language.experimental.macros object Macros { def impl(c: WhiteboxContext) = { import c.universe._ q"if (true) Some(2) else None" } def foo: Any = macro impl }
object Test extends App { val x: Option[Int] = Macros.foo }
12:25 ~/Projects/Master/sandbox (master)$ scalac Macros.scala && scalac Test.scala Test.scala:2: error: type mismatch; found : Any required: Option[Int] val x: Option[Int] = Macros.foo ^ one error found
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-8048?orig=1 Reporter: @xeno-by Affected Versions: 2.11.0-M7
Sorry, something went wrong.
@xeno-by said: Caused by pt sometimes leaking into the type of the if, even when the lub of branch types is more precise: https://github.com/scala/scala/blob/d938f59e40e7ba97b199e5f70f252d191c19d93e/src/compiler/scala/tools/nsc/typechecker/Typers.scala#L4221.
pt
@xeno-by said: Related: #6992
@xeno-by said: scala/scala#3236
xeno-by
No branches or pull requests
The text was updated successfully, but these errors were encountered: