diff --git a/compiler/testData/diagnostics/tests/platformTypes/samConstructor.txt b/compiler/testData/diagnostics/tests/platformTypes/samConstructor.txt new file mode 100644 index 00000000000..a60e97c2409 --- /dev/null +++ b/compiler/testData/diagnostics/tests/platformTypes/samConstructor.txt @@ -0,0 +1,3 @@ +package + +internal fun test(): kotlin.Unit \ No newline at end of file diff --git a/core/descriptors/src/org/jetbrains/jet/lang/types/TypeUtils.java b/core/descriptors/src/org/jetbrains/jet/lang/types/TypeUtils.java index b97e9501aef..96bfefcc23e 100644 --- a/core/descriptors/src/org/jetbrains/jet/lang/types/TypeUtils.java +++ b/core/descriptors/src/org/jetbrains/jet/lang/types/TypeUtils.java @@ -533,6 +533,11 @@ public class TypeUtils { ) { if (type == null) return false; if (isSpecialType.invoke(type)) return true; + Flexibility flexibility = type.getCapability(Flexibility.class); + if (flexibility != null + && (containsSpecialType(flexibility.getLowerBound(), isSpecialType) || containsSpecialType(flexibility.getUpperBound(), isSpecialType))) { + return true; + } for (TypeProjection projection : type.getArguments()) { if (containsSpecialType(projection.getType(), isSpecialType)) return true; }