Drop TopDownAnalysisParameters#isAnalyzingBootstrapLibrary()
This commit is contained in:
@@ -112,10 +112,7 @@ public class ReplInterpreter {
|
|||||||
|
|
||||||
GlobalContextImpl context = ContextPackage.GlobalContext();
|
GlobalContextImpl context = ContextPackage.GlobalContext();
|
||||||
|
|
||||||
TopDownAnalysisParameters topDownAnalysisParameters = TopDownAnalysisParameters.create(
|
TopDownAnalysisParameters topDownAnalysisParameters = TopDownAnalysisParameters.create(true);
|
||||||
false,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
scriptDeclarationFactory = new ScriptMutableDeclarationProviderFactory();
|
scriptDeclarationFactory = new ScriptMutableDeclarationProviderFactory();
|
||||||
|
|
||||||
|
|||||||
-1
@@ -92,7 +92,6 @@ public enum TopDownAnalyzerFacadeForJVM {
|
|||||||
@Nullable IncrementalCacheProvider incrementalCacheProvider
|
@Nullable IncrementalCacheProvider incrementalCacheProvider
|
||||||
) {
|
) {
|
||||||
TopDownAnalysisParameters topDownAnalysisParameters = TopDownAnalysisParameters.create(
|
TopDownAnalysisParameters topDownAnalysisParameters = TopDownAnalysisParameters.create(
|
||||||
false,
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -257,13 +257,11 @@ public class OverrideResolver {
|
|||||||
|
|
||||||
private void checkOverrides(@NotNull TopDownAnalysisContext c) {
|
private void checkOverrides(@NotNull TopDownAnalysisContext c) {
|
||||||
for (Map.Entry<JetClassOrObject, ClassDescriptorWithResolutionScopes> entry : c.getDeclaredClasses().entrySet()) {
|
for (Map.Entry<JetClassOrObject, ClassDescriptorWithResolutionScopes> entry : c.getDeclaredClasses().entrySet()) {
|
||||||
checkOverridesInAClass(c, entry.getValue(), entry.getKey());
|
checkOverridesInAClass(entry.getValue(), entry.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkOverridesInAClass(@NotNull TopDownAnalysisContext c, @NotNull ClassDescriptorWithResolutionScopes classDescriptor, @NotNull JetClassOrObject klass) {
|
private void checkOverridesInAClass(@NotNull ClassDescriptorWithResolutionScopes classDescriptor, @NotNull JetClassOrObject klass) {
|
||||||
if (c.getTopDownAnalysisParameters().isAnalyzingBootstrapLibrary()) return;
|
|
||||||
|
|
||||||
// Check overrides for internal consistency
|
// Check overrides for internal consistency
|
||||||
for (CallableMemberDescriptor member : classDescriptor.getDeclaredCallableMembers()) {
|
for (CallableMemberDescriptor member : classDescriptor.getDeclaredCallableMembers()) {
|
||||||
checkOverrideForMember(member);
|
checkOverrideForMember(member);
|
||||||
|
|||||||
@@ -31,35 +31,27 @@ public class TopDownAnalysisParameters extends TypeLazinessToken {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static TopDownAnalysisParameters create(
|
public static TopDownAnalysisParameters create(
|
||||||
boolean analyzingBootstrapLibrary,
|
|
||||||
boolean declaredLocally
|
boolean declaredLocally
|
||||||
) {
|
) {
|
||||||
return new TopDownAnalysisParameters(analyzingBootstrapLibrary, declaredLocally, true);
|
return new TopDownAnalysisParameters(declaredLocally, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static TopDownAnalysisParameters createForLocalDeclarations() {
|
public static TopDownAnalysisParameters createForLocalDeclarations() {
|
||||||
return new TopDownAnalysisParameters(false, true, false);
|
return new TopDownAnalysisParameters(true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final boolean analyzingBootstrapLibrary;
|
|
||||||
private final boolean declaredLocally;
|
private final boolean declaredLocally;
|
||||||
private final boolean lazyTopDownAnalysis;
|
private final boolean lazyTopDownAnalysis;
|
||||||
|
|
||||||
private TopDownAnalysisParameters(
|
private TopDownAnalysisParameters(
|
||||||
boolean analyzingBootstrapLibrary,
|
|
||||||
boolean declaredLocally,
|
boolean declaredLocally,
|
||||||
boolean lazyTopDownAnalysis
|
boolean lazyTopDownAnalysis
|
||||||
) {
|
) {
|
||||||
this.analyzingBootstrapLibrary = analyzingBootstrapLibrary;
|
|
||||||
this.declaredLocally = declaredLocally;
|
this.declaredLocally = declaredLocally;
|
||||||
this.lazyTopDownAnalysis = lazyTopDownAnalysis;
|
this.lazyTopDownAnalysis = lazyTopDownAnalysis;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAnalyzingBootstrapLibrary() {
|
|
||||||
return analyzingBootstrapLibrary;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isDeclaredLocally() {
|
public boolean isDeclaredLocally() {
|
||||||
return declaredLocally;
|
return declaredLocally;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -62,7 +62,7 @@ public class LocalClassifierAnalyzer(
|
|||||||
additionalCheckerProvider: AdditionalCheckerProvider,
|
additionalCheckerProvider: AdditionalCheckerProvider,
|
||||||
dynamicTypesSettings: DynamicTypesSettings
|
dynamicTypesSettings: DynamicTypesSettings
|
||||||
) {
|
) {
|
||||||
val topDownAnalysisParameters = TopDownAnalysisParameters.create(false, true)
|
val topDownAnalysisParameters = TopDownAnalysisParameters.create(true)
|
||||||
|
|
||||||
val moduleDescriptor = DescriptorUtils.getContainingModule(containingDeclaration)
|
val moduleDescriptor = DescriptorUtils.getContainingModule(containingDeclaration)
|
||||||
val injector = InjectorForLazyLocalClassifierAnalyzer(
|
val injector = InjectorForLazyLocalClassifierAnalyzer(
|
||||||
|
|||||||
@@ -151,7 +151,6 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir {
|
|||||||
ModuleDescriptorImpl module = TopDownAnalyzerFacadeForJVM.createSealedJavaModule();
|
ModuleDescriptorImpl module = TopDownAnalyzerFacadeForJVM.createSealedJavaModule();
|
||||||
|
|
||||||
TopDownAnalysisParameters parameters = TopDownAnalysisParameters.create(
|
TopDownAnalysisParameters parameters = TopDownAnalysisParameters.create(
|
||||||
false,
|
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import org.jetbrains.kotlin.cli.jvm.compiler.CliLightClassGenerationSupport;
|
import org.jetbrains.kotlin.cli.jvm.compiler.CliLightClassGenerationSupport;
|
||||||
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment;
|
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment;
|
||||||
import org.jetbrains.kotlin.context.ContextPackage;
|
import org.jetbrains.kotlin.context.ContextPackage;
|
||||||
import org.jetbrains.kotlin.context.GlobalContextImpl;
|
|
||||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor;
|
import org.jetbrains.kotlin.descriptors.ModuleDescriptor;
|
||||||
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl;
|
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl;
|
||||||
import org.jetbrains.kotlin.name.Name;
|
import org.jetbrains.kotlin.name.Name;
|
||||||
@@ -56,7 +55,7 @@ public class LazyResolveTestUtil {
|
|||||||
public static ModuleDescriptor resolve(@NotNull Project project, @NotNull BindingTrace trace, @NotNull List<JetFile> sourceFiles) {
|
public static ModuleDescriptor resolve(@NotNull Project project, @NotNull BindingTrace trace, @NotNull List<JetFile> sourceFiles) {
|
||||||
ModuleDescriptorImpl module = TopDownAnalyzerFacadeForJVM.createSealedJavaModule();
|
ModuleDescriptorImpl module = TopDownAnalyzerFacadeForJVM.createSealedJavaModule();
|
||||||
|
|
||||||
TopDownAnalysisParameters params = TopDownAnalysisParameters.create(false, false);
|
TopDownAnalysisParameters params = TopDownAnalysisParameters.create(false);
|
||||||
TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegrationNoIncremental(project, ContextPackage.GlobalContext(), sourceFiles, trace, params, module);
|
TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegrationNoIncremental(project, ContextPackage.GlobalContext(), sourceFiles, trace, params, module);
|
||||||
|
|
||||||
return module;
|
return module;
|
||||||
|
|||||||
+1
-1
@@ -233,7 +233,7 @@ private object KotlinResolveDataProvider {
|
|||||||
).getLazyTopDownAnalyzerForTopLevel()!!
|
).getLazyTopDownAnalyzerForTopLevel()!!
|
||||||
|
|
||||||
lazyTopDownAnalyzer.analyzeDeclarations(
|
lazyTopDownAnalyzer.analyzeDeclarations(
|
||||||
TopDownAnalysisParameters.create(false, false),
|
TopDownAnalysisParameters.create(false),
|
||||||
listOf(analyzableElement)
|
listOf(analyzableElement)
|
||||||
)
|
)
|
||||||
return AnalysisResult.success(
|
return AnalysisResult.success(
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public final class TopDownAnalyzerFacadeForJS {
|
|||||||
|
|
||||||
GlobalContextImpl globalContext = ContextPackage.GlobalContext();
|
GlobalContextImpl globalContext = ContextPackage.GlobalContext();
|
||||||
TopDownAnalysisParameters topDownAnalysisParameters = TopDownAnalysisParameters.create(
|
TopDownAnalysisParameters topDownAnalysisParameters = TopDownAnalysisParameters.create(
|
||||||
false, false);
|
false);
|
||||||
|
|
||||||
Collection<JetFile> allFiles = Config.withJsLibAdded(files, config);
|
Collection<JetFile> allFiles = Config.withJsLibAdded(files, config);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user