[JS, Frontend] Not report warning with non-exportable super type
^KT-53539 fixed
This commit is contained in:
+5
-5
@@ -6,27 +6,27 @@ package foo
|
||||
open class NonExportedClass
|
||||
|
||||
@JsExport
|
||||
class <!NON_EXPORTABLE_TYPE("super; NonExportedClass")!>ExportedClass<!> : NonExportedClass()
|
||||
class ExportedClass : NonExportedClass()
|
||||
|
||||
interface NonExportedInterface
|
||||
|
||||
@JsExport
|
||||
class <!NON_EXPORTABLE_TYPE("super; NonExportedInterface")!>ExportedClass2<!> : NonExportedInterface
|
||||
class ExportedClass2 : NonExportedInterface
|
||||
|
||||
@JsExport
|
||||
open class ExportedGenericClass<T>
|
||||
|
||||
@JsExport
|
||||
class <!NON_EXPORTABLE_TYPE("super; ExportedGenericClass<NonExportedClass>")!>ExportedClass3<!> : ExportedGenericClass<NonExportedClass>()
|
||||
class ExportedClass3 : ExportedGenericClass<NonExportedClass>()
|
||||
|
||||
@JsExport
|
||||
interface ExportedGenericInterface<T>
|
||||
|
||||
@JsExport
|
||||
class <!NON_EXPORTABLE_TYPE("super; ExportedGenericInterface<NonExportedClass>")!>ExportedClass4<!> : ExportedGenericInterface<NonExportedClass>
|
||||
class ExportedClass4 : ExportedGenericInterface<NonExportedClass>
|
||||
|
||||
@JsExport
|
||||
enum class <!NON_EXPORTABLE_TYPE("super; NonExportedInterface")!>ExportedEnum<!> : ExportedGenericInterface<Any>, NonExportedInterface {
|
||||
enum class ExportedEnum : ExportedGenericInterface<Any>, NonExportedInterface {
|
||||
EXPORTED_ENUM_1,
|
||||
EXPORTED_ENUM_2
|
||||
}
|
||||
-9
@@ -141,15 +141,6 @@ object JsExportDeclarationChecker : DeclarationChecker {
|
||||
// Covered by ENUM_CLASS
|
||||
return
|
||||
}
|
||||
|
||||
val supertypes = descriptor.defaultType.supertypes()
|
||||
val isEnum = supertypes.any { KotlinBuiltIns.isEnum(it) }
|
||||
|
||||
for (superType in supertypes) {
|
||||
if (!superType.isExportable(bindingContext) && !(KotlinBuiltIns.isComparable(superType) && isEnum)) {
|
||||
trace.report(ErrorsJs.NON_EXPORTABLE_TYPE.on(declaration, "super", superType))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user