mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 15:53:37 +00:00
Resolve static methods of enum in front-end
Up to this point, front-end did not suspect that there could be classes which have both a class object and a package for static members. Since this became possible for enums loaded from Java binaries (enum entries and valueOf()/ values() are placed into the class object, and every other static member into the package), we adjust the corresponding scope to also include members from the corresponding package #KT-2990 Fixed
This commit is contained in:
12
compiler/testData/codegen/boxWithJava/enum/staticField.java
Normal file
12
compiler/testData/codegen/boxWithJava/enum/staticField.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package test;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.EnumSet;
|
||||
|
||||
public enum staticField {
|
||||
INSTANCE;
|
||||
|
||||
public static int foo = 42;
|
||||
|
||||
public static final Set<staticField> INSTANCES = EnumSet.of(INSTANCE);
|
||||
}
|
||||
Reference in New Issue
Block a user