summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2007-05-01 12:14:47 +0000
committerIulian Dragos <jaguarul@gmail.com>2007-05-01 12:14:47 +0000
commit28a1d779aa8e720c051890efeb711bef72528573 (patch)
treebadcc41a3d143b826afc0cd85cd3d90876fd7ed3 /src/compiler
parent86e18d84dc41c3064734ff866072a9c71475939c (diff)
downloadscala-28a1d779aa8e720c051890efeb711bef72528573.tar.gz
scala-28a1d779aa8e720c051890efeb711bef72528573.tar.bz2
scala-28a1d779aa8e720c051890efeb711bef72528573.zip
Fixed #1077 by not mangling private constructor...
Fixed #1077 by not mangling private constructor names.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/backend/icode/GenICode.scala6
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala4
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Symbols.scala7
3 files changed, 10 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
index a33a820e05..85ebce3d1a 100644
--- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
+++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
@@ -622,7 +622,7 @@ abstract class GenICode extends SubComponent {
case Apply(fun @ Select(New(tpt), nme.CONSTRUCTOR), args) =>
val ctor = fun.symbol
assert(ctor.isClassConstructor,
- "'new' call to non-constructor: " + tree)
+ "'new' call to non-constructor: " + ctor.name)
generatedType = toTypeKind(tpt.tpe)
assert(generatedType.isReferenceType || generatedType.isArrayType,
@@ -951,7 +951,9 @@ abstract class GenICode extends SubComponent {
ctx1.bb.close
afterCtx
- case EmptyTree => ctx
+ case EmptyTree =>
+ ctx.bb.emit(getZeroOf(expectedType))
+ ctx
case _ =>
abort("Unexpected tree in genLoad: " + tree + " at: " +
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
index 41b7db1e18..14ba2de049 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
@@ -1326,7 +1326,9 @@ abstract class GenJVM extends SubComponent {
jf = jf | (if ((sym hasFlag Flags.ABSTRACT) ||
(sym hasFlag Flags.DEFERRED)) ACC_ABSTRACT else 0)
jf = jf | (if (sym hasFlag Flags.INTERFACE) ACC_INTERFACE else 0)
- jf = jf | (if ((sym hasFlag Flags.FINAL) && !sym.enclClass.hasFlag(Flags.INTERFACE)) ACC_FINAL else 0)
+ jf = jf | (if ((sym hasFlag Flags.FINAL)
+ && !sym.enclClass.hasFlag(Flags.INTERFACE)
+ && !sym.isClassConstructor) ACC_FINAL else 0)
jf = jf | (if (isStaticSymbol(sym)) ACC_STATIC else 0)
jf = jf | (if (sym hasFlag Flags.SYNTHETIC) ACC_SYNTHETIC else 0)
jf
diff --git a/src/compiler/scala/tools/nsc/symtab/Symbols.scala b/src/compiler/scala/tools/nsc/symtab/Symbols.scala
index 19f8773853..8b01a58feb 100644
--- a/src/compiler/scala/tools/nsc/symtab/Symbols.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Symbols.scala
@@ -357,7 +357,7 @@ trait Symbols {
*/
def originalName = nme.originalName(name)
- final def flags = {
+ final def flags: long = {
val fs = rawflags & phase.flagMask
(fs | ((fs & LateFlags) >>> LateShift)) & ~(fs >>> AntiShift)
}
@@ -858,7 +858,7 @@ trait Symbols {
if (this hasFlag PRIVATE) {
setFlag(notPRIVATE)
if (!hasFlag(DEFERRED) && isTerm) setFlag(lateFINAL)
- if (!isStaticModule) {
+ if (!isStaticModule && !isClassConstructor) {
expandName(base)
if (isModule) moduleClass.makeNotPrivate(base)
}
@@ -883,8 +883,7 @@ trait Symbols {
/** The expanded name of `name' relative to this class as base
*/
def expandedName(name: Name): Name = {
-
- newTermName(fullNameString('$') + nme.EXPAND_SEPARATOR_STRING + name)
+ newTermName(fullNameString('$') + nme.EXPAND_SEPARATOR_STRING + name)
}
def sourceFile: AbstractFile =