summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala3
-rw-r--r--test/files/res/t9170.check7
-rw-r--r--test/files/res/t9170.res2
-rw-r--r--test/files/res/t9170/A.scala4
4 files changed, 15 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index 1c9dbad4dd..b233acf271 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -1551,7 +1551,8 @@ class Global(var currentSettings: Settings, var reporter: Reporter)
if (reporter.hasErrors) {
for ((sym, file) <- symSource.iterator) {
- sym.reset(new loaders.SourcefileLoader(file))
+ if (file != null)
+ sym.reset(new loaders.SourcefileLoader(file))
if (sym.isTerm)
sym.moduleClass reset loaders.moduleClassLoader
}
diff --git a/test/files/res/t9170.check b/test/files/res/t9170.check
new file mode 100644
index 0000000000..6d40b6ba8d
--- /dev/null
+++ b/test/files/res/t9170.check
@@ -0,0 +1,7 @@
+
+nsc> t9170/A.scala:3: error: double definition:
+def f[A](a: => A): Int at line 2 and
+def f[A](a: => Either[Exception,A]): Int at line 3
+have same type after erasure: (a: Function0)Int
+ def f[A](a: => Either[Exception, A]) = 2
+ ^
diff --git a/test/files/res/t9170.res b/test/files/res/t9170.res
new file mode 100644
index 0000000000..c2aec2f8dd
--- /dev/null
+++ b/test/files/res/t9170.res
@@ -0,0 +1,2 @@
+t9170/A.scala
+t9170/A.scala
diff --git a/test/files/res/t9170/A.scala b/test/files/res/t9170/A.scala
new file mode 100644
index 0000000000..239df89679
--- /dev/null
+++ b/test/files/res/t9170/A.scala
@@ -0,0 +1,4 @@
+object Y {
+ def f[A](a: => A) = 1
+ def f[A](a: => Either[Exception, A]) = 2
+}