mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8238213: Method resolution should stop on static error
Reviewed-by: jlahoda
This commit is contained in:
parent
81fdeb579a
commit
bb3d226a4e
@ -3417,7 +3417,7 @@ public class Resolve {
|
||||
*/
|
||||
final boolean shouldStop(Symbol sym, MethodResolutionPhase phase) {
|
||||
return phase.ordinal() > maxPhase.ordinal() ||
|
||||
!sym.kind.isResolutionError() || sym.kind == AMBIGUOUS;
|
||||
!sym.kind.isResolutionError() || sym.kind == AMBIGUOUS || sym.kind == STATICERR;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8238213
|
||||
* @summary Method resolution should stop on static error
|
||||
* @compile/fail/ref=ShouldStopOnStaticError.out -XDrawDiagnostics ShouldStopOnStaticError.java
|
||||
*/
|
||||
|
||||
public class ShouldStopOnStaticError {
|
||||
static void foo() {
|
||||
test1(5.0);
|
||||
test2((Double)5.0);
|
||||
}
|
||||
|
||||
void test1(double d) {}
|
||||
void test1(Double d) {}
|
||||
|
||||
void test2(Number n) {}
|
||||
static void test2(Double... d) {}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
ShouldStopOnStaticError.java:10:9: compiler.err.non-static.cant.be.ref: kindname.method, test1(double)
|
||||
ShouldStopOnStaticError.java:11:9: compiler.err.non-static.cant.be.ref: kindname.method, test2(java.lang.Number)
|
||||
2 errors
|
||||
Loading…
x
Reference in New Issue
Block a user