summaryrefslogtreecommitdiff
path: root/test/files/neg/t8841.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2015-02-13 10:16:13 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2015-02-13 10:16:13 -0800
commit4554a10bcafce6fb14eb8b123bf76887bb6a8114 (patch)
tree0d82c10b71938c4559cc19ab438fe80bf16f6218 /test/files/neg/t8841.scala
parent73478ea4d64c62899440bfa0a748e3d57d1ab85d (diff)
parenta4a892fb0196f2f66d86f9cfa508deabe7d2aaae (diff)
downloadscala-4554a10bcafce6fb14eb8b123bf76887bb6a8114.tar.gz
scala-4554a10bcafce6fb14eb8b123bf76887bb6a8114.tar.bz2
scala-4554a10bcafce6fb14eb8b123bf76887bb6a8114.zip
Merge pull request #4195 from lrytz/t8841
SI-8841 report named arg / assignment ambiguity also in silent mode.
Diffstat (limited to 'test/files/neg/t8841.scala')
-rw-r--r--test/files/neg/t8841.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/files/neg/t8841.scala b/test/files/neg/t8841.scala
new file mode 100644
index 0000000000..80430d997e
--- /dev/null
+++ b/test/files/neg/t8841.scala
@@ -0,0 +1,15 @@
+class Cell(val ambiguousName: Option[String])
+
+class Test {
+ def wrap(f: Any): Nothing = ???
+
+ wrap {
+ // the namer for these two ValDefs is created when typing the argument expression
+ // of wrap. This happens to be in a silent context (tryTypedApply). Therefore, the
+ // cyclic reference will not be thrown, but transformed into a NormalTypeError by
+ // `silent`. This requires different handling in NamesDefaults.
+
+ val c = new Cell(ambiguousName = Some("bla"))
+ val ambiguousName = c.ambiguousName
+ }
+}