mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
ASTGen always builds with the host Swift compiler, without requiring bootstrapping, and is enabled in more places. Move the regex literal parsing logic there so it is enabled in more host environments, and makes use of CMake's Swift support. Enable all of the regex literal tests when ASTGen is built, to ensure everything is working. Remove the "AST" and "Parse" Swift modules from SwiftCompilerSources, because they are no longer needed.
21 lines
1.0 KiB
Swift
21 lines
1.0 KiB
Swift
// RUN: %target-typecheck-verify-swift -enable-bare-slash-regex -disable-availability-checking
|
|
|
|
// REQUIRES: swift_swift_parser
|
|
|
|
postfix operator ^^
|
|
postfix func ^^ <T> (_ x: T) -> T { x }
|
|
|
|
prefix operator !!
|
|
prefix func !! <T> (_ x: T) -> T { x }
|
|
|
|
// rdar://92469692 - Make sure we get a correct fix-it location here.
|
|
func foo<T>(_ x: T, y: Int) {} // expected-note 3{{'foo(_:y:)' declared here}}
|
|
foo(/a/) // expected-error {{missing argument for parameter 'y' in call}} {{8-8=, y: <#Int#>}}
|
|
foo(/,/) // expected-error {{missing argument for parameter 'y' in call}} {{8-8=, y: <#Int#>}}
|
|
foo(/a/^^) // expected-error {{missing argument for parameter 'y' in call}} {{10-10=, y: <#Int#>}}
|
|
|
|
func bar<T>(x: Int, _ y: T) {} // expected-note 3{{'bar(x:_:)' declared here}}
|
|
bar(/a/) // expected-error {{missing argument for parameter 'x' in call}} {{5-5=x: <#Int#>, }}
|
|
bar(/,/) // expected-error {{missing argument for parameter 'x' in call}} {{5-5=x: <#Int#>, }}
|
|
bar(!!/a/) // expected-error {{missing argument for parameter 'x' in call}} {{5-5=x: <#Int#>, }}
|