[TypeChecker] Enable result builder AST transform by default

This commit is contained in:
Pavel Yaskevich
2022-08-05 11:24:17 -07:00
committed by Pavel Yaskevich
parent ed630db6e9
commit 697dfbae96
14 changed files with 53 additions and 116 deletions

View File

@@ -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'}}
}
}