Fri, 24 May 2013 15:27:12 +0100
8014649: Regression: bug in Resolve.resolveOperator
Summary: Missing curly braces causes Resolve.findMethod to be called spuriously
Reviewed-by: jjg, vromero
duke@1 | 1 | /* |
duke@1 | 2 | * @test /nodynamiccopyright/ |
duke@1 | 3 | * @bug 4074421 4277278 4785453 |
duke@1 | 4 | * @summary Verify that a local class cannot be redefined within its scope. |
duke@1 | 5 | * @author William Maddox (maddox) |
duke@1 | 6 | * |
jjg@611 | 7 | * @compile/fail/ref=LocalClasses_2.out -XDrawDiagnostics LocalClasses_2.java |
duke@1 | 8 | */ |
duke@1 | 9 | |
duke@1 | 10 | class LocalClasses_2 { |
duke@1 | 11 | |
duke@1 | 12 | void foo() { |
duke@1 | 13 | class Local { } |
duke@1 | 14 | { |
duke@1 | 15 | class Local { } // ERROR |
duke@1 | 16 | } |
duke@1 | 17 | } |
duke@1 | 18 | |
duke@1 | 19 | void bar() { |
duke@1 | 20 | |
duke@1 | 21 | class Local { } |
duke@1 | 22 | |
duke@1 | 23 | class Baz { |
duke@1 | 24 | void quux() { |
duke@1 | 25 | class Local { } // OK |
duke@1 | 26 | } |
duke@1 | 27 | } |
duke@1 | 28 | |
duke@1 | 29 | class Quux { |
duke@1 | 30 | void baz() { |
duke@1 | 31 | class Random { |
duke@1 | 32 | void quem() { |
duke@1 | 33 | class Local { } // OK |
duke@1 | 34 | } |
duke@1 | 35 | } |
duke@1 | 36 | } |
duke@1 | 37 | } |
duke@1 | 38 | } |
duke@1 | 39 | } |