Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0181-sr8930.swift
Doug Gregor 5e439f7647 [Mangling] Mangle types as generic only when they have generic arguments.
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.
2018-11-05 23:31:32 -08:00

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]
}
}