diff options
author | Martin Odersky <odersky@gmail.com> | 2015-11-08 17:45:33 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-11-09 15:45:40 +0100 |
commit | 820bd7ec55bc8ef621204dc82f56a80e2d2459f0 (patch) | |
tree | 84b5f8e1e68b61a4d66f70edb12b9750ecb81c13 /src/dotty/tools/dotc/ast/untpd.scala | |
parent | 27e65efdf56f7fc9968d3a9ee63022aa9dc34a24 (diff) | |
download | dotty-820bd7ec55bc8ef621204dc82f56a80e2d2459f0.tar.gz dotty-820bd7ec55bc8ef621204dc82f56a80e2d2459f0.tar.bz2 dotty-820bd7ec55bc8ef621204dc82f56a80e2d2459f0.zip |
Avoid taking references before toplevel symbols are entered.
Taking a reference means that the symbol will be brought forward into the current run,
then if the same symbol is entered from source, a datarace ensues.
This affected the ProductN symbols because these are automatically added to a case class
suring desugaring.
Diffstat (limited to 'src/dotty/tools/dotc/ast/untpd.scala')
-rw-r--r-- | src/dotty/tools/dotc/ast/untpd.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/ast/untpd.scala b/src/dotty/tools/dotc/ast/untpd.scala index 3f3e1bf37..28a3cf1ff 100644 --- a/src/dotty/tools/dotc/ast/untpd.scala +++ b/src/dotty/tools/dotc/ast/untpd.scala @@ -201,7 +201,9 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo { def ref(tp: NamedType)(implicit ctx: Context): Tree = TypedSplice(tpd.ref(tp)) - def scalaUnit(implicit ctx: Context) = ref(defn.UnitType) + def rootDot(name: Name) = Select(Ident(nme.ROOTPKG), name) + def scalaDot(name: Name) = Select(rootDot(nme.scala_), name) + def scalaUnit = scalaDot(tpnme.Unit) def makeConstructor(tparams: List[TypeDef], vparamss: List[List[ValDef]], rhs: Tree = EmptyTree)(implicit ctx: Context): DefDef = DefDef(nme.CONSTRUCTOR, tparams, vparamss, TypeTree(), rhs) |