map intersection type to its common supertype
This commit is contained in:
@@ -376,8 +376,16 @@ public class JetTypeMapper {
|
||||
}
|
||||
}
|
||||
|
||||
final TypeConstructor constructor = jetType.getConstructor();
|
||||
if (constructor instanceof IntersectionTypeConstructor) {
|
||||
jetType = CommonSupertypes.commonSupertype(new ArrayList<JetType>(constructor.getSupertypes()));
|
||||
}
|
||||
DeclarationDescriptor descriptor = jetType.getConstructor().getDeclarationDescriptor();
|
||||
|
||||
if (descriptor == null) {
|
||||
throw new UnsupportedOperationException("no descriptor for type constructor of " + jetType);
|
||||
}
|
||||
|
||||
if (ErrorUtils.isError(descriptor)) {
|
||||
if (classBuilderMode != ClassBuilderMode.SIGNATURES) {
|
||||
throw new IllegalStateException("error types are not allowed when classBuilderMode = " + classBuilderMode);
|
||||
|
||||
Reference in New Issue
Block a user