mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The `isSpecialized()` check didn’t account for the possibility that a typealias in a parent of a nominal type could be non-generic when the parent declaration was generic, leading to incorrect mangling that stated that they were generic but had no generic arguments. Fixes SR-8930 / rdar://problem/45216653 and rdar://problem/45813164.
47 lines
1.3 KiB
Swift
47 lines
1.3 KiB
Swift
// RUN: %target-swift-frontend -emit-ir -g -o - %s
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
public final class Foo: NSObject, Collection {
|
|
public var storage = [String: Any]()
|
|
|
|
public typealias DictionaryType = [String: Any]
|
|
public typealias IndexDistance = Int
|
|
public typealias Indices = DictionaryType.Indices
|
|
public typealias Iterator = DictionaryType.Iterator
|
|
public typealias SubSequence = DictionaryType.SubSequence
|
|
public typealias Index = DictionaryType.Index
|
|
|
|
public var startIndex: Index { return storage.startIndex }
|
|
public var endIndex: DictionaryType.Index { return storage.endIndex }
|
|
public subscript(position: Index) -> Iterator.Element {
|
|
return storage[position]
|
|
}
|
|
|
|
public subscript(bounds: Range<Index>) -> SubSequence {
|
|
return storage[bounds]
|
|
}
|
|
|
|
public var indices: Indices { return storage.indices }
|
|
|
|
public subscript(key: String) -> Any? {
|
|
get { return storage[key] }
|
|
set { storage[key] = newValue }
|
|
}
|
|
|
|
public func index(after i: Index) -> Index { return storage.index(after: i) }
|
|
|
|
public func makeIterator() -> DictionaryIterator<String, Any> {
|
|
return storage.makeIterator()
|
|
}
|
|
|
|
public override func value(forKey key: String) -> Any? {
|
|
return storage[key]
|
|
}
|
|
|
|
public override func value(forUndefinedKey key: String) -> Any? {
|
|
return storage[key]
|
|
}
|
|
}
|