-
Notifications
You must be signed in to change notification settings - Fork 14
Quasiquotes use Symbol.exists, which isn't (currently) threadsafe in runtime reflection #409
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
Comments
This failed in the nightly release build for 2.12.x last night. Right before I was planning to cut 2.12.3. Hmmmm. |
val MaxTupleArity, MaxProductArity, MaxFunctionArity = 22
lazy val ProductClass = new VarArityClass("Product", MaxProductArity, countFrom = 1, init = Some(UnitClass))
lazy val TupleClass = new VarArityClass("Tuple", MaxTupleArity, countFrom = 1)
...
class VarArityClass(name: String, maxArity: Int, countFrom: Int = 0, init: Option[ClassSymbol] = None) extends VarArityClassApi {
private val offset = countFrom - init.size
private def isDefinedAt(i: Int) = i < seq.length + offset && i >= offset
val seq: IndexedSeq[ClassSymbol] = (init ++: countFrom.to(maxArity).map { i => getRequiredClass("scala." + name + i) }).toVector
def apply(i: Int) = if (isDefinedAt(i)) seq(i - offset) else NoSymbol
}
...
object SyntacticTuple extends SyntacticTupleExtractor {
def apply(args: List[Tree]): Tree = {
require(args.isEmpty || TupleClass(args.length).exists, s"Tuples with ${args.length} arity aren't supported")
gen.mkTuple(args)
} |
Maybe: a new or latent race condition in runtime reflection? |
No sign of that exception with a arity < 22 on google |
I can repro with 2.12.2.
I won't hold up the 2.12.3 release on account of this. The fix will be one or more of:
/cc @densh @xeno-by in case they have ever run into this, or something that might have the same root cause. |
https://scala-ci.typesafe.com/job/scala-2.12.x-integrate-bootstrap/1040/consoleFull
The text was updated successfully, but these errors were encountered: