Native: enable lazy IR generation before running fake override builder
^KT-48816 Fixed Native compiler uses lazy IR for declarations provided by cinterop. The problem: `FakeOverrideBuilder` requests super types during type checking, accessing `.owner` for them. So if a type and super type are represented as lazy IR, and lazy IR generation is not enabled yet, then the super type symbol won't be bound by this moment, and the access will fail. This happens in KT-48816: fake override builder tries to access `.owner` for `IrClassSymbol` of `NSObject` (super type of `NSDate` and `NSUUID`). Fix this by enabling lazy IR generation before building fake overrides.
This commit is contained in:
committed by
Space
parent
b76e670ad5
commit
ea7160947a
@@ -4327,6 +4327,10 @@ if (PlatformInfo.isAppleTarget(project)) {
|
||||
it.defFile 'interop/objc/kt42172/objclib.def'
|
||||
it.headers "$projectDir/interop/objc/kt42172/objclib.h"
|
||||
}
|
||||
createInterop("objc_kt48816") {
|
||||
it.defFile 'interop/objc/kt48816/objclib.def'
|
||||
it.headers "$projectDir/interop/objc/kt48816/objclib.h"
|
||||
}
|
||||
}
|
||||
|
||||
createInterop("withSpaces") {
|
||||
@@ -4952,6 +4956,20 @@ if (PlatformInfo.isAppleTarget(project)) {
|
||||
}
|
||||
}
|
||||
|
||||
interopTest("interop_objc_kt48816_without_lazy_ir_for_caches") {
|
||||
// Without a fix, fails in two-stage mode.
|
||||
source = "interop/objc/kt48816/main.kt"
|
||||
interop = "objc_kt48816"
|
||||
// The bug was accidentally fixed with lazy IR for caches, so testing it with this feature disabled:
|
||||
flags = ["-Xlazy-ir-for-caches=disable"]
|
||||
}
|
||||
|
||||
interopTest("interop_objc_kt48816_with_lazy_ir_for_caches") {
|
||||
source = "interop/objc/kt48816/main.kt"
|
||||
interop = "objc_kt48816"
|
||||
flags = ["-Xlazy-ir-for-caches=enable"]
|
||||
}
|
||||
|
||||
standaloneTest("objc_arc_contract") {
|
||||
doBeforeBuild {
|
||||
mkdir(buildDir)
|
||||
|
||||
Reference in New Issue
Block a user