mirror of
https://github.com/morluto/rea.git
synced 2026-10-22 13:52:32 -05:00
* feat(native): decode Swift nominal type declarations from __swift5_types Fill swift_decls from the nominal type context descriptors that survive stripping: kind (class, struct, enum, actor), own and qualified name, module, generic flag, anonymous-context flag, metadata accessor and descriptor location, with evidence citing the type record. Unresolved parent contexts keep qualified_name null and the entry partial. One shared reader walks each context once; class vtable recovery now consumes its descriptors instead of re-reading the records, so a type record that cannot be read keeps both facets partial. Remove the never-populated swift_decls fields that descriptors do not carry. Fixes #5341 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(native): bound Swift context walks and decode vtables in record order Address review of the nominal-type reader: - Cache intrinsic context depth (distance to the module) so a cached parent cannot bypass the 32-context bound, and never cache a stop that depends on where the walk began. Bound qualified names to 4096 characters so nesting cannot multiply name storage. - Visit each descriptor as soon as its kind and name are read, so a class vtable spends the record budget in record order instead of after every later declaration. - Report an accessor outside executable mapped code as null and keep the declaration partial. - Forward a name failure to vtable coverage only when the record is a class or its kind is unknown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
728 B
Swift
25 lines
728 B
Swift
public protocol ReaWitnessFixtureProtocol { func fixtureValue() -> Int }
|
|
public struct ReaWitnessFixture: ReaWitnessFixtureProtocol {
|
|
public init() {}
|
|
public func fixtureValue() -> Int { 17 }
|
|
}
|
|
@_cdecl("rea_witness_fixture_entry")
|
|
public func fixtureEntry() -> Int { ReaWitnessFixture().fixtureValue() }
|
|
|
|
public class ReaVtableFixture {
|
|
public init() {}
|
|
public func fixtureValue() -> Int { 23 }
|
|
}
|
|
|
|
public enum ReaDeclFixtureEnum { case first, second(Int) }
|
|
public struct ReaDeclFixtureOuter {
|
|
public struct Inner { public init() {} }
|
|
}
|
|
public struct ReaDeclFixtureGeneric<Value> {
|
|
public var value: Value
|
|
public init(_ value: Value) { self.value = value }
|
|
}
|
|
public actor ReaDeclFixtureActor {
|
|
public init() {}
|
|
}
|