diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-09-14 07:17:21 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-09-14 07:17:21 -0700 |
commit | 52abc96229e624f6b31ee30ffced945ff652c994 (patch) | |
tree | 11fe65914d07979e0328840bedf31be2d38e62b6 | |
parent | 255e096f1ac0f0c8f19d599404ef668af0f28341 (diff) | |
parent | a2c870569c124cbf090f7c85cea3269d95ff4170 (diff) | |
download | scala-52abc96229e624f6b31ee30ffced945ff652c994.tar.gz scala-52abc96229e624f6b31ee30ffced945ff652c994.tar.bz2 scala-52abc96229e624f6b31ee30ffced945ff652c994.zip |
Merge pull request #1272 from paulp/issue/6340
Fix for SI-6340, error message regression.
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Namers.scala | 1 | ||||
-rw-r--r-- | test/files/neg/t6340.check | 10 | ||||
-rw-r--r-- | test/files/neg/t6340.scala | 21 |
3 files changed, 31 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index 62f01b8afa..161df00220 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -496,7 +496,6 @@ trait Namers extends MethodSynthesis { // for Java code importing Scala objects if (!nme.isModuleName(from) || isValid(nme.stripModuleSuffix(from))) { typer.TyperErrorGen.NotAMemberError(tree, expr, from) - typer.infer.setError(tree) } } // Setting the position at the import means that if there is diff --git a/test/files/neg/t6340.check b/test/files/neg/t6340.check new file mode 100644 index 0000000000..f18b8c3f4b --- /dev/null +++ b/test/files/neg/t6340.check @@ -0,0 +1,10 @@ +t6340.scala:11: error: value D is not a member of object Foo + import Foo.{ A, B, C, D, E, X, Y, Z } + ^ +t6340.scala:16: error: not found: type D + val d = new D + ^ +t6340.scala:17: error: not found: type W + val w = new W + ^ +three errors found diff --git a/test/files/neg/t6340.scala b/test/files/neg/t6340.scala new file mode 100644 index 0000000000..8934d5c15d --- /dev/null +++ b/test/files/neg/t6340.scala @@ -0,0 +1,21 @@ +object Foo { + class A + class B + class C + class X + class Y + class Z +} + +object Test { + import Foo.{ A, B, C, D, E, X, Y, Z } + + val a = new A + val b = new B + val c = new C + val d = new D + val w = new W + val x = new X + val y = new Y + val z = new Z +} |