diff options
author | Martin Odersky <odersky@gmail.com> | 2015-11-07 12:58:33 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-11-09 15:45:37 +0100 |
commit | 8978ae6dfabae562fb5dcf4c7f66983d4d865892 (patch) | |
tree | 999cd971a10b46ec307c550a5af464329495c6c9 /src/dotty/tools/dotc/ast/Desugar.scala | |
parent | f2b61ce055fccf96e305ef43fca8abef8a912f33 (diff) | |
download | dotty-8978ae6dfabae562fb5dcf4c7f66983d4d865892.tar.gz dotty-8978ae6dfabae562fb5dcf4c7f66983d4d865892.tar.bz2 dotty-8978ae6dfabae562fb5dcf4c7f66983d4d865892.zip |
First versions of Definitions based on TypeRefs not Symbols.
Symbols are not stable between runs, so if some symbol referred
to from Definitions gets recompiled, there are then two Symbols
that are both visible, one referenced from Definitions, the other
the one that got compiled.
Thos led to a crash when e.g. compiling scala.Short, because the
newly compiled symbol was not recognized as a primitive value
class.
The present commit tries to make systematic changes without regard
to simplicity or aesthetics. This will be polished in future commits.
// ### comments signal areas that need further attention.
Diffstat (limited to 'src/dotty/tools/dotc/ast/Desugar.scala')
-rw-r--r-- | src/dotty/tools/dotc/ast/Desugar.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/ast/Desugar.scala b/src/dotty/tools/dotc/ast/Desugar.scala index 33205dfd4..ad34533aa 100644 --- a/src/dotty/tools/dotc/ast/Desugar.scala +++ b/src/dotty/tools/dotc/ast/Desugar.scala @@ -323,7 +323,7 @@ object desugar { def anyRef = ref(defn.AnyRefAlias.typeRef) def productConstr(n: Int) = { - val tycon = ref(defn.ProductNClass(n).typeRef) + val tycon = ref(defn.ProductNTypeRef(n)) val targs = constrVparamss.head map (_.tpt) if (targs.isEmpty) tycon else AppliedTypeTree(tycon, targs) } @@ -825,15 +825,15 @@ object desugar { } else { val arity = ts.length - def tupleClass = defn.TupleClass(arity) + def tupleTypeRef = defn.TupleTypeRef(arity) if (arity > Definitions.MaxTupleArity) { ctx.error(s"tuple too long (max allowed: ${Definitions.MaxTupleArity})", tree.pos) unitLiteral } else if (arity == 1) ts.head - else if (ctx.mode is Mode.Type) AppliedTypeTree(ref(tupleClass.typeRef), ts) + else if (ctx.mode is Mode.Type) AppliedTypeTree(ref(tupleTypeRef), ts) else if (arity == 0) unitLiteral - else Apply(ref(tupleClass.companionModule.valRef), ts) + else Apply(ref(tupleTypeRef.classSymbol.companionModule.valRef), ts) } case WhileDo(cond, body) => // { <label> def while$(): Unit = if (cond) { body; while$() } ; while$() } |