Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-add annotation trait location test case #1157

Merged
merged 1 commit into from
Mar 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,45 @@ document documentTrait
@trait
string stringTrait

/// Documentation
@sensitive
@internal()
@deprecated(
@trait
structure annotationTrait {}

// This is used to test that trait locations are properly set for a variety of
// trait types. The locations for annotation traits in particular used to be
// fraught. To ensure there's no regressions, do not remove any traits from
// here. If a trait absolutely must be removed, replace it with a custom
// trait that looks exactly the same, like those above. At minimum there
// should be one trait for each Node type, including a case for every syntactic
// variation.

/// Documentation trait using the doc comment syntax
@annotationTrait // Annotation trait without parens
@internal() // Annotation trait with parens
@deprecated( // Structured trait with no braces
since: "1.0"
)
@tags(["foo"])
@unstable({})
@stringTrait("foo")
@tags(["foo"]) // List trait
@unstable({}) // Structured trait with braces
@stringTrait("foo") // String trait using normal string syntax
@since("""
0.9""")
@numberTrait(1)
@boolTrait(true)
@documentTrait(null)
0.9""") // String trait using block syntax
@numberTrait(1) // Number trait
@boolTrait(true) // Boolean trait
@documentTrait(null) // Null value trait
structure TraitBearer {
/// Documentation
@internal()
@deprecated(
/// Documentation trait using the doc comment syntax
@annotationTrait // Annotation trait without parens
@internal() // Annotation trait with parens
@deprecated( // Structured trait with no braces
since: "1.0"
)
@tags(["foo"])
@unstable({})
@pattern("foo")
@tags(["foo"]) // List trait
@unstable({}) // Structured trait with braces
@stringTrait("foo") // String trait using normal string syntax
@since("""
0.9""")
@numberTrait(1)
@boolTrait(true)
@documentTrait(null)
0.9""") // String trait using block syntax
@numberTrait(1) // Number trait
@boolTrait(true) // Boolean trait
@documentTrait(null) // Null value trait
member: String
}