diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2010-06-15 12:48:10 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2010-06-15 12:48:10 +0000 |
commit | 707078efcd40f9eb544018108a726a39d5bbdd06 (patch) | |
tree | db13fb45883ed92e092b79e98d2205423de495d7 | |
parent | 0f7ee5e8f2bd094926d3a7011834c2ca426bd2ba (diff) | |
download | scala-707078efcd40f9eb544018108a726a39d5bbdd06.tar.gz scala-707078efcd40f9eb544018108a726a39d5bbdd06.tar.bz2 scala-707078efcd40f9eb544018108a726a39d5bbdd06.zip |
Merged revisions 22275 via svnmerge from
https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk
........
r22275 | dragos | 2010-06-14 13:27:45 +0200 (Mon, 14 Jun 2010) | 1 line
Closes #3558.
........
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Constructors.scala | 8 | ||||
-rw-r--r-- | test/files/run/spec-constr.check | 2 | ||||
-rw-r--r-- | test/files/run/spec-constr.scala | 14 |
3 files changed, 20 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Constructors.scala b/src/compiler/scala/tools/nsc/transform/Constructors.scala index c9049d9ab1..21db224eef 100644 --- a/src/compiler/scala/tools/nsc/transform/Constructors.scala +++ b/src/compiler/scala/tools/nsc/transform/Constructors.scala @@ -16,6 +16,7 @@ import util.TreeSet abstract class Constructors extends Transform with ast.TreeDSL { import global._ import definitions._ + import collection.mutable /** the following two members override abstract members in Transform */ val phaseName: String = "constructors" @@ -23,11 +24,10 @@ abstract class Constructors extends Transform with ast.TreeDSL { protected def newTransformer(unit: CompilationUnit): Transformer = new ConstructorTransformer(unit) - class ConstructorTransformer(unit: CompilationUnit) extends Transformer { - import collection.mutable + private val guardedCtorStats: mutable.Map[Symbol, List[Tree]] = new mutable.HashMap[Symbol, List[Tree]] + private val ctorParams: mutable.Map[Symbol, List[Symbol]] = new mutable.HashMap[Symbol, List[Symbol]] - private val guardedCtorStats: mutable.Map[Symbol, List[Tree]] = new mutable.HashMap[Symbol, List[Tree]] - private val ctorParams: mutable.Map[Symbol, List[Symbol]] = new mutable.HashMap[Symbol, List[Symbol]] + class ConstructorTransformer(unit: CompilationUnit) extends Transformer { def transformClassTemplate(impl: Template): Template = { val clazz = impl.symbol.owner // the transformed class diff --git a/test/files/run/spec-constr.check b/test/files/run/spec-constr.check new file mode 100644 index 0000000000..29d70d9de8 --- /dev/null +++ b/test/files/run/spec-constr.check @@ -0,0 +1,2 @@ +hello? +goodbye diff --git a/test/files/run/spec-constr.scala b/test/files/run/spec-constr.scala new file mode 100644 index 0000000000..4c80d0954d --- /dev/null +++ b/test/files/run/spec-constr.scala @@ -0,0 +1,14 @@ +object Test { + class E[@specialized(Int) A](var f: A => Boolean) { + def this() = this(null) + + println("hello?") + if (f == null) f = { _ => false } + } + + def main(args: Array[String]) { + new E[Int] + println("goodbye") + } +} + |