rename Kt to Kotlin in KtType, KtIcons
This commit is contained in:
@@ -32,8 +32,8 @@ import org.jetbrains.kotlin.resolve.scopes.KtScope
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||
import org.jetbrains.kotlin.serialization.deserialization.DeserializationContext
|
||||
import org.jetbrains.kotlin.serialization.deserialization.TypeDeserializer
|
||||
import org.jetbrains.kotlin.types.KtType
|
||||
import org.jetbrains.kotlin.types.KtTypeImpl
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.KotlinTypeImpl
|
||||
import org.jetbrains.kotlin.utils.Printer
|
||||
import java.lang.reflect.Constructor
|
||||
import java.lang.reflect.GenericDeclaration
|
||||
@@ -159,7 +159,7 @@ class LazyOperationsLog(
|
||||
val text = when {
|
||||
typeProto.hasClassName() -> context.nameResolver.getClassId(typeProto.className).asSingleFqName().asString()
|
||||
typeProto.hasTypeParameter() -> {
|
||||
val classifier = (o as KtType).constructor.declarationDescriptor!!
|
||||
val classifier = (o as KotlinType).constructor.declarationDescriptor!!
|
||||
"" + classifier.name + " in " + DescriptorUtils.getFqName(classifier.containingDeclaration)
|
||||
}
|
||||
else -> "???"
|
||||
@@ -183,7 +183,7 @@ class LazyOperationsLog(
|
||||
sb.append(" }")
|
||||
}
|
||||
}
|
||||
o is KtTypeImpl -> {
|
||||
o is KotlinTypeImpl -> {
|
||||
StringBuilder {
|
||||
append(o.getConstructor())
|
||||
if (!o.getArguments().isEmpty()) {
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.jetbrains.kotlin.resolve.AnalyzerScriptParameter;
|
||||
import org.jetbrains.kotlin.resolve.AnalyzingUtils;
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatform;
|
||||
import org.jetbrains.kotlin.test.JetTestUtils;
|
||||
import org.jetbrains.kotlin.types.KtType;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
import org.jetbrains.kotlin.types.Variance;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -131,7 +131,7 @@ public class CodegenTestFiles {
|
||||
String valueString = scriptParametersMatcher.group(3);
|
||||
Object value;
|
||||
|
||||
KtType jetType;
|
||||
KotlinType jetType;
|
||||
KotlinBuiltIns builtIns = JvmPlatform.INSTANCE$.getBuiltIns();
|
||||
if (type.equals("kotlin.String")) {
|
||||
value = valueString;
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.jetbrains.kotlin.resolve.BindingContextUtils;
|
||||
import org.jetbrains.kotlin.test.ConfigurationKind;
|
||||
import org.jetbrains.kotlin.test.JetTestUtils;
|
||||
import org.jetbrains.kotlin.test.TestJdkKind;
|
||||
import org.jetbrains.kotlin.types.KtType;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Modifier;
|
||||
@@ -121,7 +121,7 @@ public class TestlibTest extends UsefulTestCase {
|
||||
BindingContext.DECLARATION_TO_DESCRIPTOR,
|
||||
declaration);
|
||||
|
||||
for (KtType superType : getAllSupertypes(descriptor.getDefaultType())) {
|
||||
for (KotlinType superType : getAllSupertypes(descriptor.getDefaultType())) {
|
||||
if (!"junit/framework/Test".equals(typeMapper.mapType(superType).getInternalName())) continue;
|
||||
|
||||
String name = typeMapper.mapClass(descriptor).getInternalName();
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.jetbrains.kotlin.renderer.DescriptorRenderer;
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatform;
|
||||
import org.jetbrains.kotlin.resolve.lazy.JvmResolveUtil;
|
||||
import org.jetbrains.kotlin.types.ErrorUtils;
|
||||
import org.jetbrains.kotlin.types.KtType;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
import org.jetbrains.kotlin.types.TypeConstructor;
|
||||
|
||||
import java.util.List;
|
||||
@@ -244,7 +244,7 @@ public abstract class ExpectedResolveData {
|
||||
continue;
|
||||
}
|
||||
|
||||
KtType actualType = bindingContext.get(BindingContext.TYPE, typeReference);
|
||||
KotlinType actualType = bindingContext.get(BindingContext.TYPE, typeReference);
|
||||
assertNotNull("Type " + name + " not resolved for reference " + name, actualType);
|
||||
ClassifierDescriptor expectedClass = builtIns.getBuiltInClassByName(Name.identifier(name.substring(STANDARD_PREFIX.length())));
|
||||
assertNotNull("Expected class not found: " + name);
|
||||
@@ -299,7 +299,7 @@ public abstract class ExpectedResolveData {
|
||||
PsiElement element = position.getElement();
|
||||
KtExpression expression = getAncestorOfType(KtExpression.class, element);
|
||||
|
||||
KtType expressionType = bindingContext.getType(expression);
|
||||
KotlinType expressionType = bindingContext.getType(expression);
|
||||
TypeConstructor expectedTypeConstructor;
|
||||
if (typeName.startsWith(STANDARD_PREFIX)) {
|
||||
String name = typeName.substring(STANDARD_PREFIX.length());
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.jetbrains.kotlin.resolve.scopes.utils.ScopeUtilsKt;
|
||||
import org.jetbrains.kotlin.test.JetTestUtils;
|
||||
import org.jetbrains.kotlin.tests.di.ContainerForTests;
|
||||
import org.jetbrains.kotlin.tests.di.InjectionKt;
|
||||
import org.jetbrains.kotlin.types.KtType;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
import org.jetbrains.kotlin.types.TypeUtils;
|
||||
import org.jetbrains.kotlin.types.expressions.ExpressionTypingContext;
|
||||
|
||||
@@ -129,7 +129,7 @@ public class JetExpectedResolveDataUtil {
|
||||
ClassDescriptor classDescriptor,
|
||||
String name,
|
||||
Project project,
|
||||
KtType... parameterTypes
|
||||
KotlinType... parameterTypes
|
||||
) {
|
||||
ModuleDescriptorImpl emptyModule = JetTestUtils.createEmptyModule();
|
||||
ContainerForTests container = InjectionKt.createContainerForTests(project, emptyModule);
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ import org.jetbrains.kotlin.test.JetLiteFixture
|
||||
import org.jetbrains.kotlin.test.JetTestUtils
|
||||
import org.jetbrains.kotlin.tests.di.createContainerForTests
|
||||
import org.jetbrains.kotlin.types.ErrorUtils
|
||||
import org.jetbrains.kotlin.types.KtType
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
import java.io.File
|
||||
import java.util.ArrayList
|
||||
@@ -86,7 +86,7 @@ abstract public class AbstractConstraintSystemTest() : JetLiteFixture() {
|
||||
constraintSystem.registerTypeVariables(typeParameterDescriptors, { Variance.INVARIANT })
|
||||
|
||||
val constraints = parseConstraints(constraintsFileText)
|
||||
fun KtType.assertNotError(): KtType {
|
||||
fun KotlinType.assertNotError(): KotlinType {
|
||||
assert(!ErrorUtils.containsErrorType(this)) { "Type $this is resolved to or contains error type" }
|
||||
return this
|
||||
}
|
||||
|
||||
+4
-4
@@ -30,8 +30,8 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
|
||||
import org.jetbrains.kotlin.resolve.scopes.KtScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.LexicalScope
|
||||
import org.jetbrains.kotlin.test.JetTestUtils
|
||||
import org.jetbrains.kotlin.types.KtType
|
||||
import org.jetbrains.kotlin.types.KtTypeImpl
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.KotlinTypeImpl
|
||||
import java.util.regex.Pattern
|
||||
|
||||
public class ConstraintSystemTestData(
|
||||
@@ -60,11 +60,11 @@ public class ConstraintSystemTestData(
|
||||
throw AssertionError("Unsupported type parameter name: $name. You may add it to constraintSystem/declarations.kt")
|
||||
}
|
||||
|
||||
fun getType(name: String): KtType {
|
||||
fun getType(name: String): KotlinType {
|
||||
val matcher = INTEGER_VALUE_TYPE_PATTERN.matcher(name)
|
||||
if (matcher.find()) {
|
||||
val number = matcher.group(1)!!
|
||||
return KtTypeImpl.create(
|
||||
return KotlinTypeImpl.create(
|
||||
Annotations.EMPTY, IntegerValueTypeConstructor(number.toLong(), functionFoo.builtIns), false, listOf(),
|
||||
KtScope.Empty
|
||||
)
|
||||
|
||||
@@ -74,7 +74,7 @@ import org.jetbrains.kotlin.resolve.lazy.JvmResolveUtil;
|
||||
import org.jetbrains.kotlin.resolve.lazy.LazyResolveTestUtil;
|
||||
import org.jetbrains.kotlin.storage.LockBasedStorageManager;
|
||||
import org.jetbrains.kotlin.test.util.JetTestUtilsKt;
|
||||
import org.jetbrains.kotlin.types.KtType;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
import org.jetbrains.kotlin.types.expressions.JetTypeInfo;
|
||||
import org.jetbrains.kotlin.util.slicedMap.ReadOnlySlice;
|
||||
import org.jetbrains.kotlin.util.slicedMap.SlicedMap;
|
||||
@@ -148,7 +148,7 @@ public class JetTestUtils {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public KtType getType(@NotNull KtExpression expression) {
|
||||
public KotlinType getType(@NotNull KtExpression expression) {
|
||||
return DUMMY_TRACE.getType(expression);
|
||||
}
|
||||
|
||||
@@ -183,13 +183,13 @@ public class JetTestUtils {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public KtType getType(@NotNull KtExpression expression) {
|
||||
public KotlinType getType(@NotNull KtExpression expression) {
|
||||
JetTypeInfo typeInfo = get(BindingContext.EXPRESSION_TYPE_INFO, expression);
|
||||
return typeInfo != null ? typeInfo.getType() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recordType(@NotNull KtExpression expression, @Nullable KtType type) {
|
||||
public void recordType(@NotNull KtExpression expression, @Nullable KotlinType type) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -231,7 +231,7 @@ public class JetTestUtils {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public KtType getType(@NotNull KtExpression expression) {
|
||||
public KotlinType getType(@NotNull KtExpression expression) {
|
||||
return DUMMY_EXCEPTION_ON_ERROR_TRACE.getType(expression);
|
||||
}
|
||||
|
||||
@@ -264,12 +264,12 @@ public class JetTestUtils {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public KtType getType(@NotNull KtExpression expression) {
|
||||
public KotlinType getType(@NotNull KtExpression expression) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recordType(@NotNull KtExpression expression, @Nullable KtType type) {
|
||||
public void recordType(@NotNull KtExpression expression, @Nullable KotlinType type) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
|
||||
import org.jetbrains.kotlin.descriptors.*;
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation;
|
||||
import org.jetbrains.kotlin.resolve.scopes.KtScope;
|
||||
import org.jetbrains.kotlin.types.KtType;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
import org.junit.Assert;
|
||||
|
||||
import java.io.PrintStream;
|
||||
@@ -93,7 +93,7 @@ public class DescriptorValidator {
|
||||
|
||||
private void validateType(
|
||||
@NotNull DeclarationDescriptor descriptor,
|
||||
@Nullable KtType type,
|
||||
@Nullable KotlinType type,
|
||||
@NotNull DiagnosticCollector collector
|
||||
) {
|
||||
if (type == null) {
|
||||
@@ -134,9 +134,9 @@ public class DescriptorValidator {
|
||||
private void validateTypes(
|
||||
DeclarationDescriptor descriptor,
|
||||
DiagnosticCollector collector,
|
||||
Collection<KtType> types
|
||||
Collection<KotlinType> types
|
||||
) {
|
||||
for (KtType type : types) {
|
||||
for (KotlinType type : types) {
|
||||
validateType(descriptor, type, collector);
|
||||
}
|
||||
}
|
||||
@@ -163,8 +163,8 @@ public class DescriptorValidator {
|
||||
DeclarationDescriptor descriptor,
|
||||
DiagnosticCollector collector,
|
||||
String name,
|
||||
KtType expected,
|
||||
KtType actual
|
||||
KotlinType expected,
|
||||
KotlinType actual
|
||||
) {
|
||||
if (expected.isError() && actual.isError()) {
|
||||
assertEquals(descriptor, collector, name, expected.toString(), actual.toString());
|
||||
@@ -235,7 +235,7 @@ public class DescriptorValidator {
|
||||
) {
|
||||
validateTypeParameters(collector, descriptor.getTypeConstructor().getParameters());
|
||||
|
||||
Collection<KtType> supertypes = descriptor.getTypeConstructor().getSupertypes();
|
||||
Collection<KotlinType> supertypes = descriptor.getTypeConstructor().getSupertypes();
|
||||
if (supertypes.isEmpty() && descriptor.getKind() != ClassKind.INTERFACE
|
||||
&& !KotlinBuiltIns.isSpecialClassWithNoSupertypes(descriptor)) {
|
||||
report(collector, descriptor, "No supertypes for non-trait");
|
||||
|
||||
@@ -65,7 +65,7 @@ abstract class AbstractJetTypeBindingTest : JetLiteFixture() {
|
||||
}
|
||||
|
||||
private class MyPrinter(out: StringBuilder) : Printer(out) {
|
||||
private fun KtType.render() = DescriptorRenderer.SHORT_NAMES_IN_TYPES.renderType(this)
|
||||
private fun KotlinType.render() = DescriptorRenderer.SHORT_NAMES_IN_TYPES.renderType(this)
|
||||
private fun TypeParameterDescriptor?.render() = if (this == null) "null" else DescriptorRenderer.SHORT_NAMES_IN_TYPES.render(this)
|
||||
|
||||
fun print(argument: TypeArgumentBinding<*>?): MyPrinter {
|
||||
|
||||
@@ -498,10 +498,10 @@ public class JetTypeCheckerTest extends JetLiteFixture {
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private void assertSupertypes(String typeStr, String... supertypeStrs) {
|
||||
Set<KtType> allSupertypes = TypeUtils.getAllSupertypes(makeType(scopeWithImports, typeStr));
|
||||
Set<KtType> expected = Sets.newHashSet();
|
||||
Set<KotlinType> allSupertypes = TypeUtils.getAllSupertypes(makeType(scopeWithImports, typeStr));
|
||||
Set<KotlinType> expected = Sets.newHashSet();
|
||||
for (String supertypeStr : supertypeStrs) {
|
||||
KtType supertype = makeType(scopeWithImports, supertypeStr);
|
||||
KotlinType supertype = makeType(scopeWithImports, supertypeStr);
|
||||
expected.add(supertype);
|
||||
}
|
||||
assertEquals(expected, allSupertypes);
|
||||
@@ -516,27 +516,27 @@ public class JetTypeCheckerTest extends JetLiteFixture {
|
||||
}
|
||||
|
||||
private void assertIntersection(String expected, String... types) {
|
||||
Set<KtType> typesToIntersect = new LinkedHashSet<KtType>();
|
||||
Set<KotlinType> typesToIntersect = new LinkedHashSet<KotlinType>();
|
||||
for (String type : types) {
|
||||
typesToIntersect.add(makeType(type));
|
||||
}
|
||||
KtType result = TypeIntersector.intersectTypes(KotlinTypeChecker.DEFAULT, typesToIntersect);
|
||||
KotlinType result = TypeIntersector.intersectTypes(KotlinTypeChecker.DEFAULT, typesToIntersect);
|
||||
// assertNotNull("Intersection is null for " + typesToIntersect, result);
|
||||
assertEquals(makeType(expected), result);
|
||||
}
|
||||
|
||||
private void assertCommonSupertype(String expected, String... types) {
|
||||
Collection<KtType> subtypes = new ArrayList<KtType>();
|
||||
Collection<KotlinType> subtypes = new ArrayList<KotlinType>();
|
||||
for (String type : types) {
|
||||
subtypes.add(makeType(type));
|
||||
}
|
||||
KtType result = CommonSupertypes.commonSupertype(subtypes);
|
||||
KotlinType result = CommonSupertypes.commonSupertype(subtypes);
|
||||
assertTrue(result + " != " + expected, result.equals(makeType(expected)));
|
||||
}
|
||||
|
||||
private void assertSubtypingRelation(String subtype, String supertype, boolean expected) {
|
||||
KtType typeNode1 = makeType(subtype);
|
||||
KtType typeNode2 = makeType(supertype);
|
||||
KotlinType typeNode1 = makeType(subtype);
|
||||
KotlinType typeNode2 = makeType(supertype);
|
||||
boolean result = KotlinTypeChecker.DEFAULT.isSubtypeOf(
|
||||
typeNode1,
|
||||
typeNode2);
|
||||
@@ -544,22 +544,22 @@ public class JetTypeCheckerTest extends JetLiteFixture {
|
||||
assertTrue(typeNode1 + " is " + modifier + "a subtype of " + typeNode2, result == expected);
|
||||
}
|
||||
|
||||
private void assertType(String expression, KtType expectedType) {
|
||||
private void assertType(String expression, KotlinType expectedType) {
|
||||
Project project = getProject();
|
||||
KtExpression ktExpression = KtPsiFactoryKt.KtPsiFactory(project).createExpression(expression);
|
||||
KtType type = expressionTypingServices.getType(ScopeUtilsKt.asLexicalScope(scopeWithImports), ktExpression, TypeUtils.NO_EXPECTED_TYPE, DataFlowInfo.EMPTY, JetTestUtils.DUMMY_TRACE);
|
||||
KotlinType type = expressionTypingServices.getType(ScopeUtilsKt.asLexicalScope(scopeWithImports), ktExpression, TypeUtils.NO_EXPECTED_TYPE, DataFlowInfo.EMPTY, JetTestUtils.DUMMY_TRACE);
|
||||
assertTrue(type + " != " + expectedType, type.equals(expectedType));
|
||||
}
|
||||
|
||||
private void assertErrorType(String expression) {
|
||||
Project project = getProject();
|
||||
KtExpression ktExpression = KtPsiFactoryKt.KtPsiFactory(project).createExpression(expression);
|
||||
KtType type = expressionTypingServices.safeGetType(ScopeUtilsKt.asLexicalScope(scopeWithImports), ktExpression, TypeUtils.NO_EXPECTED_TYPE, DataFlowInfo.EMPTY, JetTestUtils.DUMMY_TRACE);
|
||||
KotlinType type = expressionTypingServices.safeGetType(ScopeUtilsKt.asLexicalScope(scopeWithImports), ktExpression, TypeUtils.NO_EXPECTED_TYPE, DataFlowInfo.EMPTY, JetTestUtils.DUMMY_TRACE);
|
||||
assertTrue("Error type expected but " + type + " returned", type.isError());
|
||||
}
|
||||
|
||||
private void assertType(String contextType, final String expression, String expectedType) {
|
||||
final KtType thisType = makeType(contextType);
|
||||
final KotlinType thisType = makeType(contextType);
|
||||
KtScope scope = new AbstractScopeAdapter() {
|
||||
@NotNull
|
||||
@Override
|
||||
@@ -586,9 +586,9 @@ public class JetTypeCheckerTest extends JetLiteFixture {
|
||||
private void assertType(KtScope scope, String expression, String expectedTypeStr) {
|
||||
Project project = getProject();
|
||||
KtExpression ktExpression = KtPsiFactoryKt.KtPsiFactory(project).createExpression(expression);
|
||||
KtType type = expressionTypingServices.getType(
|
||||
KotlinType type = expressionTypingServices.getType(
|
||||
ScopeUtilsKt.asLexicalScope(addImports(scope)), ktExpression, TypeUtils.NO_EXPECTED_TYPE, DataFlowInfo.EMPTY, new BindingTraceContext());
|
||||
KtType expectedType = expectedTypeStr == null ? null : makeType(expectedTypeStr);
|
||||
KotlinType expectedType = expectedTypeStr == null ? null : makeType(expectedTypeStr);
|
||||
assertEquals(expectedType, type);
|
||||
}
|
||||
|
||||
@@ -630,11 +630,11 @@ public class JetTypeCheckerTest extends JetLiteFixture {
|
||||
return new ChainedScope(scope.getContainingDeclaration(), "JetTypeCheckerTest.addImports scope with imports", scopeChain.toArray(new KtScope[scopeChain.size()]));
|
||||
}
|
||||
|
||||
private KtType makeType(String typeStr) {
|
||||
private KotlinType makeType(String typeStr) {
|
||||
return makeType(scopeWithImports, typeStr);
|
||||
}
|
||||
|
||||
private KtType makeType(KtScope scope, String typeStr) {
|
||||
private KotlinType makeType(KtScope scope, String typeStr) {
|
||||
return typeResolver.resolveType(ScopeUtilsKt.asLexicalScope(scope), KtPsiFactoryKt.KtPsiFactory(getProject()).createType(typeStr), JetTestUtils.DUMMY_TRACE, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,12 +102,12 @@ public class TypeSubstitutorTest extends KotlinTestWithEnvironment {
|
||||
}
|
||||
|
||||
private void doTest(@Nullable String expectedTypeStr, String initialTypeStr, Pair<String, String>... substitutionStrs) {
|
||||
KtType initialType = resolveType(initialTypeStr);
|
||||
KotlinType initialType = resolveType(initialTypeStr);
|
||||
|
||||
Map<TypeConstructor, TypeProjection> map = stringsToSubstitutionMap(substitutionStrs);
|
||||
TypeSubstitutor substitutor = TypeSubstitutor.create(map);
|
||||
|
||||
KtType result = substitutor.substitute(initialType, Variance.INVARIANT);
|
||||
KotlinType result = substitutor.substitute(initialType, Variance.INVARIANT);
|
||||
|
||||
if (expectedTypeStr == null) {
|
||||
assertNull(result);
|
||||
@@ -129,7 +129,7 @@ public class TypeSubstitutorTest extends KotlinTestWithEnvironment {
|
||||
assertTrue(typeParameterName + " is not a type parameter: " + classifier, classifier instanceof TypeParameterDescriptor);
|
||||
|
||||
String typeStr = "C<" + replacementProjectionString + ">";
|
||||
KtType typeWithArgument = resolveType(typeStr);
|
||||
KotlinType typeWithArgument = resolveType(typeStr);
|
||||
assert !typeWithArgument.getArguments().isEmpty() : "No arguments: " + typeWithArgument + " from " + typeStr;
|
||||
|
||||
map.put(classifier.getTypeConstructor(), typeWithArgument.getArguments().get(0));
|
||||
@@ -137,11 +137,11 @@ public class TypeSubstitutorTest extends KotlinTestWithEnvironment {
|
||||
return map;
|
||||
}
|
||||
|
||||
private KtType resolveType(String typeStr) {
|
||||
private KotlinType resolveType(String typeStr) {
|
||||
KtTypeReference jetTypeReference = KtPsiFactoryKt.KtPsiFactory(getProject()).createType(typeStr);
|
||||
AnalyzingUtils.checkForSyntacticErrors(jetTypeReference);
|
||||
BindingTrace trace = new BindingTraceContext();
|
||||
KtType type = container.getTypeResolver().resolveType(ScopeUtilsKt.asLexicalScope(scope), jetTypeReference, trace, true);
|
||||
KotlinType type = container.getTypeResolver().resolveType(ScopeUtilsKt.asLexicalScope(scope), jetTypeReference, trace, true);
|
||||
if (!trace.getBindingContext().getDiagnostics().isEmpty()) {
|
||||
fail("Errors:\n" + StringUtil.join(
|
||||
trace.getBindingContext().getDiagnostics(),
|
||||
|
||||
@@ -213,7 +213,7 @@ public class TypeUnifierTest extends JetLiteFixture {
|
||||
|
||||
KtTypeReference typeReference = projection.getTypeReference();
|
||||
assert typeReference != null;
|
||||
KtType type = typeResolver.resolveType(ScopeUtilsKt.asLexicalScope(withX), typeReference, JetTestUtils.DUMMY_TRACE, true);
|
||||
KotlinType type = typeResolver.resolveType(ScopeUtilsKt.asLexicalScope(withX), typeReference, JetTestUtils.DUMMY_TRACE, true);
|
||||
|
||||
return new TypeProjectionImpl(getProjectionKind(typeStr, projection), type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user