From e29bf9f509f79a6e8b397627ec0499e66f829e35 Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 21 Feb 2011 10:52:15 +0100 Subject: [PATCH] diamonds inference: test data just-in-case --- .../advHighlighting7/DiamondMisc.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/DiamondMisc.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/DiamondMisc.java index 30b750e35c9f..d802f473b299 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/DiamondMisc.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/DiamondMisc.java @@ -42,4 +42,28 @@ class Test1 { } class FF extends F{} -class F {} \ No newline at end of file +class F {} + +class MyTest { + static class Foo { + Foo(X x) {} + } + + static interface Base {} + static class A extends Exception implements Base {} + static class B extends Exception implements Base {} + + void m() throws B { + try { + if (true) { + throw new A(); + } + else { + throw new B(); + } + } catch (A ex) { + Foo> foo1 = new Foo<>(ex); // ok + Foo> foo2 = new Foo<>(ex); // should be error + } + } +}