From 080d357a3e3c88c17626c3a2ddd6fc334cb86d2e Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sat, 16 Oct 2010 22:09:12 +0000 Subject: Made some changes to fjbg so when people run in... Made some changes to fjbg so when people run into #1133 at least it will tell them what method was the cause. The fact that ten files are touched in this commit instead of one or two is a testament to the wonder of checked exceptions. No review. --- test/files/neg/bug1133msg.check | 4 ++++ test/files/neg/bug1133msg.scala | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 test/files/neg/bug1133msg.check create mode 100644 test/files/neg/bug1133msg.scala (limited to 'test') 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 + } + } +} -- cgit v1.2.3