mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
While most class field accesses go through accessors, a special case is if you have a final field (or class) in a non-resilient module. Then, we were allowed to directly access the field. However, an earlier hack made it so that this access always went through a field offset global, which is unnecessary in the case where the class layout is fully known. One consequence of this is that 'Array.count' would compile down to a load from a global followed by an indirect load, instead of a single load from a constant offset.
8 lines
122 B
Swift
8 lines
122 B
Swift
public class Other {
|
|
public final var x: Int32 = 0
|
|
}
|
|
|
|
public class Subclass : Other {
|
|
public final var y: Int32 = 0
|
|
}
|