From 336a1fc56074b58c54951a4a351d258f23999281 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 24 Dec 2013 11:55:49 +0100 Subject: Fixed desugaring of Symbol Need to do Symbol.apply(...) instead of new Symbol(...) because symbols are hash-consed and the constructor is private. This slipped through because of the wholes in accessibility checks which will be fixed in the next commit. --- src/dotty/tools/dotc/ast/Desugar.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dotty/tools/dotc/ast/Desugar.scala b/src/dotty/tools/dotc/ast/Desugar.scala index 3ea3dcbe2..b74b455eb 100644 --- a/src/dotty/tools/dotc/ast/Desugar.scala +++ b/src/dotty/tools/dotc/ast/Desugar.scala @@ -639,7 +639,9 @@ object desugar { // begin desugar tree match { case SymbolLit(str) => - New(ref(defn.SymbolClass.typeRef), (Literal(Constant(str)) :: Nil) :: Nil) + Apply( + Select(ref(defn.SymbolClass.companionModule.termRef), nme.apply), + Literal(Constant(str)) :: Nil) case InterpolatedString(id, strs, elems) => Apply(Select(Apply(Ident(nme.StringContext), strs), id), elems) case InfixOp(l, op, r) => -- cgit v1.2.3