[AA] Add sealed inheritors tests for inheritors with the wrong package

- Inheriting from a sealed class in the wrong package is illegal, so a
  library test makes no sense here, as the test infrastructure wouldn't
  be able to compile the library.

^KT-66013
This commit is contained in:
Marco Pennekamp
2024-03-12 15:47:46 +01:00
committed by Space Team
parent ed62211e06
commit 2e00879fe1
8 changed files with 86 additions and 0 deletions
@@ -0,0 +1,19 @@
// MODULE: dependency
// FILE: MySealedClass.kt
package foo.bar
sealed class MySealedClass
class Inheritor1 : MySealedClass()
// FILE: Inheritor2.kt
package foo
import foo.bar.MySealedClass
class Inheritor2 : MySealedClass()
// MODULE: main(dependency)
// FILE: main.kt
// class: foo/bar/MySealedClass
@@ -0,0 +1,2 @@
foo/bar/Inheritor1
class Inheritor1 : foo.bar.MySealedClass()
@@ -0,0 +1,15 @@
// FILE: main.kt
package foo.bar
sealed class MySealedClass
class Inheritor1 : MySealedClass()
// FILE: Inheritor2.kt
package foo
import foo.bar.MySealedClass
class Inheritor2 : MySealedClass()
// class: foo/bar/MySealedClass
@@ -0,0 +1,2 @@
foo/bar/Inheritor1
class Inheritor1 : foo.bar.MySealedClass()