summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@epfl.ch>2010-03-17 16:02:42 +0000
committerHubert Plociniczak <hubert.plociniczak@epfl.ch>2010-03-17 16:02:42 +0000
commitfb399bce3a4f176a3805417d645c645397f35d24 (patch)
treef55d175a8b534d8a5b14c1f43699e01bc45e4134
parent9f4d2a906f12853edf8024e3487abc924046c047 (diff)
downloadscala-fb399bce3a4f176a3805417d645c645397f35d24.tar.gz
scala-fb399bce3a4f176a3805417d645c645397f35d24.tar.bz2
scala-fb399bce3a4f176a3805417d645c645397f35d24.zip
Closes #3133. Review by community.
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala7
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala2
-rw-r--r--test/files/buildmanager/t3133/A.java7
-rw-r--r--test/files/buildmanager/t3133/t3133.check3
-rw-r--r--test/files/buildmanager/t3133/t3133.test1
5 files changed, 12 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index e6c6d8a4a3..becb4b069f 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -252,13 +252,6 @@ trait Contexts { self: Analyzer =>
argContext
}
- //todo: remove
- def makeConstructorSuffixContext = {
- val c = make(tree)
- c.inConstructorSuffix = true
- c
- }
-
private def diagString =
if (diagnostic.isEmpty) ""
else diagnostic.mkString("\n","\n", "")
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index aff6aa86e6..0ddd838303 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -1159,7 +1159,7 @@ trait Namers { self: Analyzer =>
newNamer(context.makeNewScope(tree, sym)).methodSig(mods, tparams, vparamss, tpt, rhs)
case vdef @ ValDef(mods, name, tpt, rhs) =>
- val typer1 = typer.constrTyperIf(sym.hasFlag(PARAM | PRESUPER) && sym.owner.isConstructor)
+ val typer1 = typer.constrTyperIf(sym.hasFlag(PARAM | PRESUPER) && !mods.hasFlag(JAVA) && sym.owner.isConstructor)
if (tpt.isEmpty) {
if (rhs.isEmpty) {
context.error(tpt.pos, "missing parameter type");
diff --git a/test/files/buildmanager/t3133/A.java b/test/files/buildmanager/t3133/A.java
new file mode 100644
index 0000000000..9cf4d96bd4
--- /dev/null
+++ b/test/files/buildmanager/t3133/A.java
@@ -0,0 +1,7 @@
+public class A {
+ class Foo {}
+
+ public A(Foo a) {}
+
+ private void bar(Foo z) {}
+}
diff --git a/test/files/buildmanager/t3133/t3133.check b/test/files/buildmanager/t3133/t3133.check
new file mode 100644
index 0000000000..5e4e71e045
--- /dev/null
+++ b/test/files/buildmanager/t3133/t3133.check
@@ -0,0 +1,3 @@
+builder > A.java
+compiling Set(A.java)
+Changes: Map()
diff --git a/test/files/buildmanager/t3133/t3133.test b/test/files/buildmanager/t3133/t3133.test
new file mode 100644
index 0000000000..6cf7e35543
--- /dev/null
+++ b/test/files/buildmanager/t3133/t3133.test
@@ -0,0 +1 @@
+>>compile A.java