Minor: Inject builtins in ControlFlowAnalyzer

This commit is contained in:
Pavel V. Talanov
2015-07-23 17:30:09 +03:00
parent 0830e48029
commit 7203a7833a
@@ -32,9 +32,11 @@ import static org.jetbrains.kotlin.types.TypeUtils.NO_EXPECTED_TYPE;
public class ControlFlowAnalyzer {
@NotNull private final BindingTrace trace;
@NotNull private final KotlinBuiltIns builtIns;
public ControlFlowAnalyzer(@NotNull BindingTrace trace) {
public ControlFlowAnalyzer(@NotNull BindingTrace trace, @NotNull KotlinBuiltIns builtIns) {
this.trace = trace;
this.builtIns = builtIns;
}
public void process(@NotNull BodiesResolveContext c) {
@@ -65,7 +67,7 @@ public class ControlFlowAnalyzer {
private void checkSecondaryConstructor(@NotNull JetSecondaryConstructor constructor) {
JetFlowInformationProvider flowInformationProvider = new JetFlowInformationProvider(constructor, trace);
flowInformationProvider.checkDeclaration();
flowInformationProvider.checkFunction(KotlinBuiltIns.getInstance().getUnitType());
flowInformationProvider.checkFunction(builtIns.getUnitType());
}
private void checkDeclarationContainer(@NotNull BodiesResolveContext c, JetDeclarationContainer declarationContainer) {