forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sema: Fix recent regression with -disable-experimental-associated-typ…
…e-inference This just brings back a bunch of old brittle logic conditionalized on the negation of the flag. Fixes rdar://problem/122810266.
- Loading branch information
1 parent
38fdb5b
commit cfc684c
Showing
8 changed files
with
342 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
test/decl/protocol/req/associated_type_inference_abstract.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 99 additions & 4 deletions
103
test/decl/protocol/req/associated_type_inference_stdlib_4.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,107 @@ | ||
// RUN: %target-typecheck-verify-swift -disable-experimental-associated-type-inference | ||
// RUN: %target-typecheck-verify-swift -enable-experimental-associated-type-inference | ||
// RUN: %target-swift-frontend -emit-silgen %s -disable-experimental-associated-type-inference -DA1 | ||
// RUN: %target-swift-frontend -emit-silgen %s -disable-experimental-associated-type-inference -DA2 | ||
// RUN: %target-swift-frontend -emit-silgen %s -disable-experimental-associated-type-inference -DA3 | ||
// RUN: %target-swift-frontend -emit-silgen %s -disable-experimental-associated-type-inference -DA4 | ||
// RUN: %target-swift-frontend -emit-silgen %s -disable-experimental-associated-type-inference -DA5 | ||
// RUN: %target-swift-frontend -emit-silgen %s -disable-experimental-associated-type-inference -DA6 | ||
// RUN: %target-swift-frontend -emit-silgen %s -disable-experimental-associated-type-inference -DA7 | ||
// RUN: %target-swift-frontend -emit-silgen %s -disable-experimental-associated-type-inference -DA8 | ||
// RUN: %target-swift-frontend -emit-silgen %s -disable-experimental-associated-type-inference -DA9 | ||
// RUN: %target-swift-frontend -emit-silgen %s -disable-experimental-associated-type-inference -DA10 | ||
// RUN: %target-swift-frontend -emit-silgen %s -disable-experimental-associated-type-inference -DA11 | ||
// RUN: %target-swift-frontend -emit-silgen %s -disable-experimental-associated-type-inference -DA12 | ||
// RUN: %target-swift-frontend -emit-silgen %s -disable-experimental-associated-type-inference -DA13 | ||
// RUN: %target-swift-frontend -emit-silgen %s -disable-experimental-associated-type-inference -DA14 | ||
|
||
// RUN: %target-swift-frontend -emit-silgen %s -enable-experimental-associated-type-inference -DA1 | ||
// RUN: %target-swift-frontend -emit-silgen %s -enable-experimental-associated-type-inference -DA2 | ||
// RUN: %target-swift-frontend -emit-silgen %s -enable-experimental-associated-type-inference -DA3 | ||
// RUN: %target-swift-frontend -emit-silgen %s -enable-experimental-associated-type-inference -DA4 | ||
// RUN: %target-swift-frontend -emit-silgen %s -enable-experimental-associated-type-inference -DA5 | ||
// RUN: %target-swift-frontend -emit-silgen %s -enable-experimental-associated-type-inference -DA6 | ||
// RUN: %target-swift-frontend -emit-silgen %s -enable-experimental-associated-type-inference -DA7 | ||
// RUN: %target-swift-frontend -emit-silgen %s -enable-experimental-associated-type-inference -DA8 | ||
// RUN: %target-swift-frontend -emit-silgen %s -enable-experimental-associated-type-inference -DA9 | ||
// RUN: %target-swift-frontend -emit-silgen %s -enable-experimental-associated-type-inference -DA10 | ||
// RUN: %target-swift-frontend -emit-silgen %s -enable-experimental-associated-type-inference -DA11 | ||
// RUN: %target-swift-frontend -emit-silgen %s -enable-experimental-associated-type-inference -DA12 | ||
// RUN: %target-swift-frontend -emit-silgen %s -enable-experimental-associated-type-inference -DA13 | ||
// RUN: %target-swift-frontend -emit-silgen %s -enable-experimental-associated-type-inference -DA14 | ||
|
||
#if A1 | ||
|
||
// The 'for' loop has to come first, to force Sequence.makeIterator(). | ||
for x in S() { _ = x } | ||
|
||
#elseif A2 | ||
|
||
func f<T: Sequence>(_: T.Type) -> T.Element.Type { fatalError() } | ||
let x: String.Type = f(S.self) | ||
|
||
#elseif A3 | ||
|
||
func f<T: Sequence>(_: T.Type) -> T.Iterator.Type { fatalError() } | ||
let x: IndexingIterator<S>.Type = f(S.self) | ||
|
||
#elseif A4 | ||
|
||
func f<T: Sequence>(_: T.Type) -> T.Iterator.Element.Type { fatalError() } | ||
let x: String.Type = f(S.self) | ||
|
||
#elseif A5 | ||
|
||
func f<T: Collection>(_: T.Type) -> T.Element.Type { fatalError() } | ||
let x: String.Type = f(S.self) | ||
|
||
#elseif A6 | ||
|
||
func f<T: Collection>(_: T.Type) -> T.Index.Type { fatalError() } | ||
let x: Int.Type = f(S.self) | ||
|
||
#elseif A7 | ||
|
||
func f<T: Collection>(_: T.Type) -> T.SubSequence.Type { fatalError() } | ||
let x: Slice<S>.Type = f(S.self) | ||
|
||
#elseif A8 | ||
|
||
func f<T: Collection>(_: T.Type) -> T.SubSequence.Element.Type { fatalError() } | ||
let x: String.Type = f(S.self) | ||
|
||
#elseif A9 | ||
|
||
func f<T: Collection>(_: T.Type) -> T.SubSequence.Index.Type { fatalError() } | ||
let x: Int.Type = f(S.self) | ||
|
||
#elseif A10 | ||
|
||
func f<T: Collection>(_: T.Type) -> T.SubSequence.Iterator.Type { fatalError() } | ||
let x: IndexingIterator<Slice<S>>.Type = f(S.self) | ||
|
||
#elseif A11 | ||
|
||
func f<T: Collection>(_: T.Type) -> T.Indices.Type { fatalError() } | ||
let x: Range<Int>.Type = f(S.self) | ||
|
||
#elseif A12 | ||
|
||
func f<T: Collection>(_: T.Type) -> T.Indices.Element.Type { fatalError() } | ||
let x: Int.Type = f(S.self) | ||
|
||
#elseif A13 | ||
|
||
func f<T: Collection>(_: T.Type) -> T.Indices.SubSequence.Type { fatalError() } | ||
let x: Range<Int>.Type = f(S.self) | ||
|
||
#elseif A14 | ||
|
||
func f<T: Collection>(_: T.Type) -> T.SubSequence.Indices.Type { fatalError() } | ||
let x: Range<Int>.Type = f(S.self) | ||
|
||
#endif | ||
|
||
struct S: RandomAccessCollection { | ||
public var startIndex: Int { 0 } | ||
public var endIndex: Int { 0 } | ||
public subscript(position: Int) -> Int { 0 } | ||
public subscript(position: Int) -> String { "" } | ||
} | ||
|
Oops, something went wrong.