summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-02-24 18:41:14 +0000
committerPaul Phillips <paulp@improving.org>2009-02-24 18:41:14 +0000
commit5c2635fb90c44dee3a76ae1346845aab7748d738 (patch)
tree89ae4577203d33fee32eb8393df94778cdfa2cee
parent0f81e1686bef598c5353a7187a332f3008492f29 (diff)
downloadscala-5c2635fb90c44dee3a76ae1346845aab7748d738.tar.gz
scala-5c2635fb90c44dee3a76ae1346845aab7748d738.tar.bz2
scala-5c2635fb90c44dee3a76ae1346845aab7748d738.zip
Fix and test case for #1747.
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala1
-rw-r--r--test/files/run/t1747.scala6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
index 76aec33069..df655f076c 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
@@ -736,6 +736,7 @@ abstract class GenJVM extends SubComponent {
&& !m.isConstructor
&& !m.isStaticMember
&& !(m.owner == definitions.AnyClass)
+ && !module.isSubClass(module.linkedClassOfModule)
&& !conflictsIn(definitions.ObjectClass, m.name)
&& !conflictsIn(module.linkedClassOfModule, m.name))
diff --git a/test/files/run/t1747.scala b/test/files/run/t1747.scala
new file mode 100644
index 0000000000..bcda6b52d1
--- /dev/null
+++ b/test/files/run/t1747.scala
@@ -0,0 +1,6 @@
+object Foo extends Foo {
+ def f {}
+}
+class Foo
+
+object Test extends Application { Foo } \ No newline at end of file