constructor refs: decline abstract classes (IDEA-102392)

This commit is contained in:
anna
2013-03-04 14:08:39 +01:00
parent b2ab3ee6af
commit d7c5ecacdd
2 changed files with 16 additions and 3 deletions

View File

@@ -11,6 +11,14 @@ class Test {
static class Foo<X> { }
static abstract class ABar {
protected ABar() {
}
}
static abstract class ABaz {
}
void foo(IFactory cf) { }
void testAssign() {
@@ -19,11 +27,15 @@ class Test {
<error descr="Incompatible types. Found: '<method reference>', required: 'Test.IFactory'">IFactory c3 = I::new;</error>
IFactory c4 = Foo<?>::new;
IFactory c5 = <error descr="Cannot find class 1">1</error>::new;
<error descr="Incompatible types. Found: '<method reference>', required: 'Test.IFactory'">IFactory c6 = ABar::new;</error>
<error descr="Incompatible types. Found: '<method reference>', required: 'Test.IFactory'">IFactory c7 = ABaz::new;</error>
foo<error descr="'foo(Test.IFactory)' in 'Test' cannot be applied to '(<method reference>)'">(Anno::new)</error>;
foo<error descr="'foo(Test.IFactory)' in 'Test' cannot be applied to '(<method reference>)'">(E::new)</error>;
foo<error descr="'foo(Test.IFactory)' in 'Test' cannot be applied to '(<method reference>)'">(I::new)</error>;
foo(Foo<?>::new);
foo(<error descr="Cannot find class 1">1</error>::new);
foo<error descr="'foo(Test.IFactory)' in 'Test' cannot be applied to '(<method reference>)'">(ABar::new)</error>;
foo<error descr="'foo(Test.IFactory)' in 'Test' cannot be applied to '(<method reference>)'">(ABaz::new)</error>;
}
}