diff --git a/teavm-core/src/main/java/org/teavm/dependency/DependencyGraphBuilder.java b/teavm-core/src/main/java/org/teavm/dependency/DependencyGraphBuilder.java index b3d3f1f22..a4e40f209 100644 --- a/teavm-core/src/main/java/org/teavm/dependency/DependencyGraphBuilder.java +++ b/teavm-core/src/main/java/org/teavm/dependency/DependencyGraphBuilder.java @@ -223,7 +223,12 @@ class DependencyGraphBuilder { cst = ((ValueType.Array)cst).getItemType(); } if (cst instanceof ValueType.Object) { - dependencyChecker.achieveClass(((ValueType.Object)cst).getClassName(), callerStack); + final String className = ((ValueType.Object)cst).getClassName(); + useRunners.add(new Runnable() { + @Override public void run() { + dependencyChecker.initClass(className, callerStack); + } + }); } }