Files
swift-mirror/test/attr/attr_semantics.swift
David Farler b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00

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)
}