Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0074-rdar28544316.swift
Doug Gregor ac8e8aa1b3 [GSB] Stop creating unresolved potential archetypes; rework typo correction.
The small-but-significant change to the generic signature builder is
to refuse to create unresolved potential archetypes. Instead, delay
any requirement that depends on such type, to be reprocessed once
we've seen all of the other requirements. If the type can be resolved
later, it will be; Otherwise, the type checker will complain when it
sees an unresolvable type. By itself, this fixes the crash in SR-2796.

Doing this by itself regresses diagnostics because typo correction in
the generic signature builder no longer kicks in. Therefore, implement
typo correction for these cases in the type checker proper, using its
existing facilities for typo correction. The result is more consistent
code with a better result.

Fixes SR-2796 / rdar://problem/28544316.
2017-06-29 16:52:46 -07:00

39 lines
871 B
Swift

// RUN: not %target-swift-frontend %s -emit-ir
// REQUIRES: asserts
class PropertyDataSource<O: PropertyHosting> {
}
protocol TableViewCellFactoryType {
associatedtype Item
}
public protocol PropertyHosting {
associatedtype PType: Hashable, EntityOwned
}
public protocol EntityOwned: class {
associatedtype Owner
}
public protocol PropertyType: class {
}
func useType<T>(cellType: T.Type) {
}
final class PropertyTableViewAdapter<Factory: TableViewCellFactoryType>
where
Factory.Item: PropertyType,
Factory.Item.Owner: PropertyHosting,
Factory.Item.Owner.PType == Factory.Item
{
typealias Item = Factory.Item
let dataManager: PropertyDataSource<Factory.Item.Owner>
init(dataManager: PropertyDataSource<Factory.Item.Owner>) {
useType(cellType: Factory.Item.Owner.self)
self.dataManager = dataManager
}
}