summaryrefslogtreecommitdiff
path: root/src/compiler/scala/reflect/internal/Symbols.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/reflect/internal/Symbols.scala')
-rw-r--r--src/compiler/scala/reflect/internal/Symbols.scala10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/compiler/scala/reflect/internal/Symbols.scala b/src/compiler/scala/reflect/internal/Symbols.scala
index 00e9200076..cb4d2bbf94 100644
--- a/src/compiler/scala/reflect/internal/Symbols.scala
+++ b/src/compiler/scala/reflect/internal/Symbols.scala
@@ -91,8 +91,16 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
new MethodSymbol(this, pos, name).setFlag(METHOD)
final def newLabel(pos: Position, name: TermName) =
newMethod(pos, name).setFlag(LABEL)
+
+ /** Propagates ConstrFlags (JAVA, specifically) from owner to constructor. */
final def newConstructor(pos: Position) =
- newMethod(pos, nme.CONSTRUCTOR)
+ newMethod(pos, nme.CONSTRUCTOR) setFlag getFlag(ConstrFlags)
+ /** Static constructor with info set. */
+ def newStaticConstructor(pos: Position) =
+ newConstructor(pos) setFlag STATIC setInfo UnitClass.tpe
+ /** Instance constructor with info set. */
+ def newClassConstructor(pos: Position) =
+ newConstructor(pos) setInfo MethodType(Nil, this.tpe)
private def finishModule(m: ModuleSymbol, clazz: ClassSymbol): ModuleSymbol = {
// Top-level objects can be automatically marked final, but others