Move coroutines to kotlin.coroutines package: compiler

Generate continuation type as kotlin.coroutines.Continuaion. This code will
fail at runtime since there is no stdlib backing this change yet.
However, in order to generate compatible stdlib we need a compiler, which
generates continuation type as kotlin.coroutines.Continuation.
Thus, firstly we support the change in the compiler, make it bootstrap
compiler and only then change stdlib and tests accordingly.
 #KT-23362
This commit is contained in:
Ilmir Usmanov
2018-03-21 19:54:14 +03:00
parent f8c0c54a66
commit 2cfe387bab
67 changed files with 692 additions and 694 deletions
@@ -86,7 +86,9 @@ public class JsConfig {
@Nullable List<JsModuleDescriptor<KotlinJavaScriptLibraryParts>> metadataCache,
@Nullable Set<String> librariesToSkip) {
this.project = project;
this.configuration = configuration;
this.configuration = configuration.copy();
CommonConfigurationKeysKt.setLanguageVersionSettings(this.configuration, new ReleaseCoroutinesDisabledLanguageVersionSettings(
CommonConfigurationKeysKt.getLanguageVersionSettings(this.configuration)));
this.metadataCache = metadataCache;
this.librariesToSkip = librariesToSkip;
}
@@ -0,0 +1,52 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.js.config;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.config.*;
public class ReleaseCoroutinesDisabledLanguageVersionSettings implements LanguageVersionSettings {
@NotNull
private final LanguageVersionSettings delegate;
public ReleaseCoroutinesDisabledLanguageVersionSettings(@NotNull LanguageVersionSettings delegate) {
this.delegate = delegate;
}
@NotNull
@Override
public LanguageFeature.State getFeatureSupport(@NotNull LanguageFeature feature) {
if (feature.equals(LanguageFeature.ReleaseCoroutines)) {
return LanguageFeature.State.DISABLED;
}
return delegate.getFeatureSupport(feature);
}
@Override
public <T> T getFlag(@NotNull AnalysisFlag<? extends T> flag) {
return delegate.getFlag(flag);
}
@NotNull
@Override
public ApiVersion getApiVersion() {
return delegate.getApiVersion();
}
@NotNull
@Override
public LanguageVersion getLanguageVersion() {
return delegate.getLanguageVersion();
}
@Override
public boolean supportsFeature(@NotNull LanguageFeature feature) {
if (feature.equals(LanguageFeature.ReleaseCoroutines)) {
return false;
}
return delegate.supportsFeature(feature);
}
}