ensure static fields/static initializers are evaluated before instance fields (IDEA-165084)

This commit is contained in:
Anna.Kozlova
2016-12-07 11:11:08 +01:00
parent f9ab833e50
commit 5732b8fb81
2 changed files with 27 additions and 10 deletions

View File

@@ -299,3 +299,13 @@ class DefiniteAssignmentInFinally {
}
}
}
class StaticInitializerUsedInAnotherInstanceField {
private final int myEnumerationCacheConstant = ENUMERATION_CACHE_SIZE;
private static final int ourEnumerationCacheConstant = <error descr="Illegal forward reference">ENUMERATION_CACHE_SIZE</error>;
private static final int ENUMERATION_CACHE_SIZE;
static {
ENUMERATION_CACHE_SIZE = 0;
}
}