[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
|
open class NonExportedClass
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
class <!NON_EXPORTABLE_TYPE("super; NonExportedClass")!>ExportedClass<!> : NonExportedClass()
|
class ExportedClass : NonExportedClass()
|
||||||
|
|
||||||
interface NonExportedInterface
|
interface NonExportedInterface
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
class <!NON_EXPORTABLE_TYPE("super; NonExportedInterface")!>ExportedClass2<!> : NonExportedInterface
|
class ExportedClass2 : NonExportedInterface
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
open class ExportedGenericClass<T>
|
open class ExportedGenericClass<T>
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
class <!NON_EXPORTABLE_TYPE("super; ExportedGenericClass<NonExportedClass>")!>ExportedClass3<!> : ExportedGenericClass<NonExportedClass>()
|
class ExportedClass3 : ExportedGenericClass<NonExportedClass>()
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
interface ExportedGenericInterface<T>
|
interface ExportedGenericInterface<T>
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
class <!NON_EXPORTABLE_TYPE("super; ExportedGenericInterface<NonExportedClass>")!>ExportedClass4<!> : ExportedGenericInterface<NonExportedClass>
|
class ExportedClass4 : ExportedGenericInterface<NonExportedClass>
|
||||||
|
|
||||||
@JsExport
|
@JsExport
|
||||||
enum class <!NON_EXPORTABLE_TYPE("super; NonExportedInterface")!>ExportedEnum<!> : ExportedGenericInterface<Any>, NonExportedInterface {
|
enum class ExportedEnum : ExportedGenericInterface<Any>, NonExportedInterface {
|
||||||
EXPORTED_ENUM_1,
|
EXPORTED_ENUM_1,
|
||||||
EXPORTED_ENUM_2
|
EXPORTED_ENUM_2
|
||||||
}
|
}
|
||||||
-9
@@ -141,15 +141,6 @@ object JsExportDeclarationChecker : DeclarationChecker {
|
|||||||
// Covered by ENUM_CLASS
|
// Covered by ENUM_CLASS
|
||||||
return
|
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