diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/bug1133msg.check | 4 | ||||
-rw-r--r-- | test/files/neg/bug1133msg.scala | 33 |
2 files changed, 37 insertions, 0 deletions
diff --git a/test/files/neg/bug1133msg.check b/test/files/neg/bug1133msg.check new file mode 100644 index 0000000000..5b499ef12f --- /dev/null +++ b/test/files/neg/bug1133msg.check @@ -0,0 +1,4 @@ +bug1133msg.scala:1: error: cannot emit bytecode for Match$.badMethod: offset too big to fit in 16 bits: 53273 +object Match { + ^ +one error found diff --git a/test/files/neg/bug1133msg.scala b/test/files/neg/bug1133msg.scala new file mode 100644 index 0000000000..b4a29aff4d --- /dev/null +++ b/test/files/neg/bug1133msg.scala @@ -0,0 +1,33 @@ +object Match { + def someMethod = 5 + + def badMethod(s: String) = s match { + case Extractor1(Extractor2(Extractor3("dog", "dog", "dog"), x2, x3), b, c, Extractor3("b", "b", f), e) => println(e) + case Extractor3(Extractor2(Extractor1("a", "aa", "aaa", "aa", "a"), Extractor2("a", "aa", "aaa"), e), y, z) => println(e) + case Extractor2(Extractor3("a", "a", x), Extractor3("b", "b", y), Extractor3("c", "c", z)) => println(z) + case _ => println("fail") + } + + def someOtherMethod = 10 + + object Extractor1 { + def unapply(x: Any) = x match { + case x: String => Some(x, x+x, x+x+x, x+x, x) + case _ => None + } + } + + object Extractor2 { + def unapply(x: Any) = x match { + case x: String => Some(x, x+x, x+x+x) + case _ => None + } + } + + object Extractor3 { + def unapply(x: Any) = x match { + case x: String => Some(x, x, x) + case _ => None + } + } +} |