Files
swift-mirror/validation-test/IDE/crashers_2_fixed/rdar76686564.swift
Alex Hoppen 4566bf3136 [Sema] Remove TypeCheckExprFlags::AllowUnresolvedTypeVariables
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
2021-05-10 20:11:43 +02:00

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^# }
}