Files
swift-mirror/test/IRGen/Inputs/other_class.swift
Slava Pestov 7c0ee05a2f IRGen: Don't unconditionally use field offset globals for cross-module class field access
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.
2018-08-02 02:01:01 -07:00

8 lines
122 B
Swift

public class Other {
public final var x: Int32 = 0
}
public class Subclass : Other {
public final var y: Int32 = 0
}