mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[TypeChecker] Enable result builder AST transform by default
This commit is contained in:
committed by
Pavel Yaskevich
parent
ed630db6e9
commit
697dfbae96
@@ -3,14 +3,11 @@
|
||||
import RegexBuilder
|
||||
|
||||
extension Regex where Output == Substring {
|
||||
init(_ x: String) {} // expected-note {{'init(_:)' declared here}}
|
||||
init(_ x: String) {}
|
||||
}
|
||||
|
||||
func foo() {
|
||||
// FIXME: This diagnostic could probably be better, it's not clear we should
|
||||
// be resolving to init(_ x: String) vs the result builder API and diagnosing
|
||||
// the fact that Int isn't a RegexComponent.
|
||||
_ = Regex { // expected-error {{trailing closure passed to parameter of type 'String' that does not accept a closure}}
|
||||
0
|
||||
_ = Regex {
|
||||
0 // expected-error {{static method 'buildExpression' requires that 'Int' conform to 'RegexComponent'}}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user