Files
swift-mirror/test/Serialization/Inputs/def_xref_extensions.swift
Jordan Rose c86f8e7089 [Serialization] Improve extensions of nested types with the same name (#7397)
Previously looking up an extension would result in all extensions for
types with the same name (nested or not) being deserialized; this
could even bring in base types that had not been deserialized yet. Add
in a string to distinguish an extension's base type; in the top-level
case this is just a module name, but for nested types it's a full
mangled name.

This is a little heavier than I'd like it to be, since it means we
mangle names and then throw them away, and since it means there's a
whole bunch of extra string data in the module just for uniquely
identifying a declaration. But it's correct, and does less work than
before, and fixes a circularity issue with a nested type A.B.A that
apparently used to work.

https://bugs.swift.org/browse/SR-3915
2017-02-13 12:42:12 -08:00

30 lines
562 B
Swift

public struct Outer {
public struct InterestingValue {}
}
public struct Other {
public struct InterestingValue {}
}
public struct InterestingValue {}
extension Outer.InterestingValue {
public static func foo() {}
}
extension Other.InterestingValue {
public static func bar() {}
}
extension InterestingValue {
public static func bar() {}
}
#if EXTRA
// Make sure that adding more of these doesn't change anything.
extension Other.InterestingValue {
public static func baz() {}
}
extension InterestingValue {
public static func baz() {}
}
#endif