mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Remove the `TypeCheckExprFlags::AllowUnresolvedTypeVariables` flag, fixing another occurance of rdar://76686564 (https://github.com/apple/swift/pull/37309) This does not break anything in the test suite, so I think the removal of the flag is fine. Resolves rdar://76686564 and rdar://77659417
29 lines
1.0 KiB
Swift
29 lines
1.0 KiB
Swift
// RUN: %target-swift-ide-test --conforming-methods -code-completion-token=COMPLETE_EXPR --conforming-methods-expected-types=s:14swift_ide_test10MySequenceP -source-filename %s
|
|
// RUN: %target-swift-ide-test --conforming-methods -code-completion-token=COMPLETE_STMT --conforming-methods-expected-types=s:14swift_ide_test10MySequenceP -source-filename %s
|
|
|
|
protocol MySequence {
|
|
associatedtype Element
|
|
}
|
|
|
|
struct Foo<X>: MySequence {
|
|
typealias Element = X
|
|
}
|
|
|
|
struct ArgumentDefinition {
|
|
fileprivate func bashCompletionWords() -> Foo<String> { fatalError() }
|
|
}
|
|
|
|
func myFlatMap<SegmentOfResult: MySequence>(_ transform: (ArgumentDefinition) -> SegmentOfResult) -> Foo<SegmentOfResult.Element> {
|
|
fatalError()
|
|
}
|
|
|
|
func generateArgumentWords() {
|
|
// Explicitly coerce the type using 'as'. This is type checked as an expression.
|
|
_ = myFlatMap { $0.#^COMPLETE_EXPR^# } as Foo<String>
|
|
}
|
|
|
|
func generateArgumentWords() -> Foo<String> {
|
|
// Implicitly coerce the type from the return type. This is type checked as a stmt.
|
|
return myFlatMap { $0.#^COMPLETE_STMT^# }
|
|
}
|