mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
A parse-only option is needed for parse performance tracking and the current option also includes semantic analysis.
22 lines
610 B
Swift
22 lines
610 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
@_semantics("foo")
|
|
@_semantics("bar")
|
|
func duplicatesemantics() {}
|
|
|
|
func func_with_nested_semantics_1() {
|
|
@_semantics("exit") // expected-error {{attribute '_semantics' can only be used in a non-local scope}}
|
|
func exit(_ code : UInt32) -> Void
|
|
exit(0)
|
|
}
|
|
|
|
// Test parser recovery by having something that
|
|
// should parse fine.
|
|
func somethingThatShouldParseFine() {}
|
|
|
|
func func_with_nested_semantics_2() {
|
|
@_semantics("exit") // expected-error {{attribute '_semantics' can only be used in a non-local scope}}
|
|
func exit(_ code : UInt32) -> Void
|
|
exit(0)
|
|
}
|