Files
2023-08-16 19:11:34 +00:00

40 lines
3.2 KiB
Kotlin
Vendored

import abitestutils.abiTest
fun box() = abiTest {
expectFailure(linkage("Type operator expression can not be evaluated: Expression uses unlinked class symbol '/SC1.Removed'")) { compute(SC1.O2) }
expectFailure(linkage("Type operator expression can not be evaluated: Expression uses unlinked class symbol '/SC1.Removed'")) { compute(SC1.C2()) }
expectFailure(linkage("Constructor 'Removed.<init>' can not be called: No constructor found for symbol '/SC1.Removed.<init>'")) { compute(SC1.Removed()) }
expectSuccess { compute(SC1.O1) }
expectSuccess { compute(SC1.C1()) }
expectFailure(linkage("Can not get instance of singleton 'Removed': No class found for symbol '/SC2.Removed'")) { compute(SC2.O2) }
expectFailure(linkage("Can not get instance of singleton 'Removed': No class found for symbol '/SC2.Removed'")) { compute(SC2.C2()) }
expectFailure(linkage("Can not get instance of singleton 'Removed': No class found for symbol '/SC2.Removed'")) { compute(SC2.Removed) }
expectSuccess { compute(SC2.O1) }
expectSuccess { compute(SC2.C1()) }
expectFailure(linkage("Type operator expression can not be evaluated: Expression uses unlinked class symbol '/SI1.Removed'")) { compute(object : SI1.I2 {}) }
expectFailure(linkage("Type operator expression can not be evaluated: Expression uses unlinked class symbol '/SI1.Removed'")) { compute(SI1.O2) }
expectFailure(linkage("Type operator expression can not be evaluated: Expression uses unlinked class symbol '/SI1.Removed'")) { compute(SI1.C2()) }
expectFailure(linkage("Constructor 'Removed.<init>' can not be called: No constructor found for symbol '/SI1.Removed.<init>'")) { compute(SI1.Removed()) }
expectSuccess { compute(object : SI1.I1 {}) }
expectSuccess { compute(SI1.O1) }
expectSuccess { compute(SI1.C1()) }
expectFailure(linkage("Can not get instance of singleton 'Removed': No class found for symbol '/SI2.Removed'")) { compute(object : SI2.I2 {}) }
expectFailure(linkage("Can not get instance of singleton 'Removed': No class found for symbol '/SI2.Removed'")) { compute(SI2.O2) }
expectFailure(linkage("Can not get instance of singleton 'Removed': No class found for symbol '/SI2.Removed'")) { compute(SI2.C2()) }
expectFailure(linkage("Can not get instance of singleton 'Removed': No class found for symbol '/SI2.Removed'")) { compute(SI2.Removed) }
expectSuccess { compute(object : SI2.I1 {}) }
expectSuccess { compute(SI2.O1) }
expectSuccess { compute(SI2.C1()) }
expectFailure(linkage("Type operator expression can not be evaluated: Expression uses unlinked class symbol '/SI3.Removed'")) { compute(object : SI3.I2 {}) }
expectFailure(linkage("Type operator expression can not be evaluated: Expression uses unlinked class symbol '/SI3.Removed'")) { compute(SI3.O2) }
expectFailure(linkage("Type operator expression can not be evaluated: Expression uses unlinked class symbol '/SI3.Removed'")) { compute(SI3.C2()) }
expectFailure(linkage("Constructor '<init>' can not be called: Anonymous object uses unlinked class symbol '/SI3.Removed'")) { compute(object : SI3.Removed {}) }
expectSuccess { compute(object : SI3.I1 {}) }
expectSuccess { compute(SI3.O1) }
expectSuccess { compute(SI3.C1()) }
}