Extract 'descriptors' module
This commit is contained in:
Generated
+1
@@ -7,6 +7,7 @@
|
||||
<element id="archive" name="kotlin-plugin.jar">
|
||||
<element id="module-output" name="backend" />
|
||||
<element id="module-output" name="frontend" />
|
||||
<element id="module-output" name="descriptors" />
|
||||
<element id="module-output" name="frontend.java" />
|
||||
<element id="module-output" name="descriptor.loader.java" />
|
||||
<element id="module-output" name="idea" />
|
||||
|
||||
Generated
+1
@@ -12,6 +12,7 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/compiler/integration-tests/compiler-integration-tests.iml" filepath="$PROJECT_DIR$/compiler/integration-tests/compiler-integration-tests.iml" group="compiler/cli" />
|
||||
<module fileurl="file://$PROJECT_DIR$/compiler/tests/compiler-tests.iml" filepath="$PROJECT_DIR$/compiler/tests/compiler-tests.iml" group="compiler" />
|
||||
<module fileurl="file://$PROJECT_DIR$/core/descriptor.loader.java/descriptor.loader.java.iml" filepath="$PROJECT_DIR$/core/descriptor.loader.java/descriptor.loader.java.iml" group="core" />
|
||||
<module fileurl="file://$PROJECT_DIR$/core/descriptors/descriptors.iml" filepath="$PROJECT_DIR$/core/descriptors/descriptors.iml" group="core" />
|
||||
<module fileurl="file://$PROJECT_DIR$/compiler/frontend/frontend.iml" filepath="$PROJECT_DIR$/compiler/frontend/frontend.iml" group="compiler" />
|
||||
<module fileurl="file://$PROJECT_DIR$/compiler/frontend.java/frontend.java.iml" filepath="$PROJECT_DIR$/compiler/frontend.java/frontend.java.iml" group="compiler/java" />
|
||||
<module fileurl="file://$PROJECT_DIR$/generators/generators.iml" filepath="$PROJECT_DIR$/generators/generators.iml" group="infrastructure" />
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
<dirset id="compilerSources.dirset" dir="${basedir}/">
|
||||
<include name="compiler/frontend/src"/>
|
||||
<include name="core/descriptors/src"/>
|
||||
<include name="compiler/frontend/serialization/src"/>
|
||||
<include name="core/descriptor.loader.java/src"/>
|
||||
<include name="compiler/frontend.java/src"/>
|
||||
@@ -44,6 +45,7 @@
|
||||
<property name="idea.out" value="${basedir}/out/production"/>
|
||||
<patternset id="compilerClassesFromIDEA.fileset">
|
||||
<include name="frontend/**"/>
|
||||
<include name="descriptors/**"/>
|
||||
<include name="serialization/**"/>
|
||||
<include name="descriptor.loader.java/**"/>
|
||||
<include name="frontend.java/**"/>
|
||||
@@ -132,6 +134,7 @@
|
||||
<jar jarfile="${output}/kotlin-compiler-sources.jar">
|
||||
<!-- TODO How to convert it from pathset or dirset ? -->
|
||||
<fileset dir="compiler/frontend/src"/>
|
||||
<fileset dir="core/descriptors/src"/>
|
||||
<fileset dir="core/descriptor.loader.java/src"/>
|
||||
<fileset dir="compiler/frontend.java/src"/>
|
||||
<fileset dir="compiler/backend/src"/>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<orderEntry type="library" name="javax.inject" level="project" />
|
||||
<orderEntry type="module" module-name="util" />
|
||||
<orderEntry type="module" module-name="serialization" />
|
||||
<orderEntry type="module" module-name="descriptors" exported="" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<orderEntry type="library" name="trove4j" level="project" />
|
||||
<orderEntry type="library" name="intellij-core" level="project" />
|
||||
<orderEntry type="module" module-name="util.runtime" />
|
||||
<orderEntry type="module" module-name="descriptors" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="intellij-core" level="project" />
|
||||
<orderEntry type="module" module-name="util.runtime" />
|
||||
<orderEntry type="library" name="javax.inject" level="project" />
|
||||
<orderEntry type="module" module-name="serialization" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
+10
-9
@@ -120,8 +120,9 @@ public class ConstraintSystemImpl implements ConstraintSystem {
|
||||
};
|
||||
|
||||
public ConstraintSystemImpl() {
|
||||
this.resultingSubstitutor = createTypeSubstitutorWithDefaultForUnknownTypeParameter(new TypeProjection(CANT_INFER_TYPE_PARAMETER));
|
||||
this.currentSubstitutor = createTypeSubstitutorWithDefaultForUnknownTypeParameter(new TypeProjection(DONT_CARE));
|
||||
this.resultingSubstitutor = createTypeSubstitutorWithDefaultForUnknownTypeParameter(new TypeProjection(
|
||||
TypeUtils.CANT_INFER_TYPE_PARAMETER));
|
||||
this.currentSubstitutor = createTypeSubstitutorWithDefaultForUnknownTypeParameter(new TypeProjection(TypeUtils.DONT_CARE));
|
||||
}
|
||||
|
||||
private TypeSubstitutor createTypeSubstitutorWithDefaultForUnknownTypeParameter(@Nullable final TypeProjection defaultTypeProjection) {
|
||||
@@ -134,7 +135,7 @@ public class ConstraintSystemImpl implements ConstraintSystem {
|
||||
|
||||
if (typeParameterConstraints.containsKey(descriptor)) {
|
||||
JetType value = getTypeConstraints(descriptor).getValue();
|
||||
if (value != null && !TypeUtils.equalsOrContainsAsArgument(value, DONT_CARE)) {
|
||||
if (value != null && !TypeUtils.equalsOrContainsAsArgument(value, TypeUtils.DONT_CARE)) {
|
||||
return new TypeProjection(value);
|
||||
}
|
||||
return defaultTypeProjection;
|
||||
@@ -202,7 +203,7 @@ public class ConstraintSystemImpl implements ConstraintSystem {
|
||||
@NotNull JetType subjectType,
|
||||
@NotNull ConstraintPosition constraintPosition
|
||||
) {
|
||||
if (constrainingType != null && noExpectedType(constrainingType)) return;
|
||||
if (constrainingType != null && TypeUtils.noExpectedType(constrainingType)) return;
|
||||
|
||||
if (constraintPosition == ConstraintPosition.EXPECTED_TYPE_POSITION) {
|
||||
systemWithoutExpectedTypeConstraint = copy();
|
||||
@@ -262,11 +263,11 @@ public class ConstraintSystemImpl implements ConstraintSystem {
|
||||
}
|
||||
|
||||
private boolean isErrorOrSpecialType(@Nullable JetType type) {
|
||||
if (type == DONT_CARE || type == CANT_INFER_TYPE_PARAMETER) {
|
||||
if (type == TypeUtils.DONT_CARE || type == TypeUtils.CANT_INFER_TYPE_PARAMETER) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (type == null || (type.isError() && type != PLACEHOLDER_FUNCTION_TYPE)) {
|
||||
if (type == null || (type.isError() && type != TypeUtils.PLACEHOLDER_FUNCTION_TYPE)) {
|
||||
hasErrorInConstrainingTypes = true;
|
||||
return true;
|
||||
}
|
||||
@@ -284,10 +285,10 @@ public class ConstraintSystemImpl implements ConstraintSystem {
|
||||
if (isErrorOrSpecialType(subType) || isErrorOrSpecialType(superType)) return;
|
||||
assert subType != null && superType != null;
|
||||
|
||||
assert superType != PLACEHOLDER_FUNCTION_TYPE : "The type for " + constraintPosition + " shouldn't be a placeholder for function type";
|
||||
assert superType != TypeUtils.PLACEHOLDER_FUNCTION_TYPE : "The type for " + constraintPosition + " shouldn't be a placeholder for function type";
|
||||
|
||||
KotlinBuiltIns kotlinBuiltIns = KotlinBuiltIns.getInstance();
|
||||
if (subType == PLACEHOLDER_FUNCTION_TYPE) {
|
||||
if (subType == TypeUtils.PLACEHOLDER_FUNCTION_TYPE) {
|
||||
if (!kotlinBuiltIns.isFunctionOrExtensionFunctionType(superType)) {
|
||||
if (isMyTypeVariable(superType)) {
|
||||
// a constraint binds type parameter and any function type, so there is no new info and no error
|
||||
@@ -303,7 +304,7 @@ public class ConstraintSystemImpl implements ConstraintSystem {
|
||||
// can be considered as extension function if one is expected
|
||||
// (special type constructor for function/ extension function should be introduced like PLACEHOLDER_FUNCTION_TYPE)
|
||||
if (constraintKind == SUB_TYPE && kotlinBuiltIns.isFunctionType(subType) && kotlinBuiltIns.isExtensionFunctionType(superType)) {
|
||||
subType = createCorrespondingExtensionFunctionType(subType, DONT_CARE);
|
||||
subType = createCorrespondingExtensionFunctionType(subType, TypeUtils.DONT_CARE);
|
||||
}
|
||||
|
||||
// can be equal for the recursive invocations:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user