-
Notifications
You must be signed in to change notification settings - Fork 146
Preserve contextual type for literal arguments: expressions in @Test
#1627
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
base: main
Are you sure you want to change the base?
Changes from 10 commits
1912d84
91213c6
c27dc5c
8d51562
51456e9
5d3e5d0
a5b1498
9bdd79d
3d6b072
90e47ed
78e75ae
5316889
542a027
ced014e
b64e134
04fa487
988f08f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -165,11 +165,24 @@ struct ParameterizedTests { | |||||
| @Test(.hidden, arguments: [("value", 123)]) | ||||||
| func one2TupleParameter(x: (String, Int)) {} | ||||||
|
|
||||||
| @Test<[(String?, Int?)]>(.hidden, arguments: [ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Generic parameters on
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed the unsupported generic argument clause from @test. The remaining type annotation is expressed as an explicit cast on the arguments: expression. |
||||||
| (nil, 123), | ||||||
| ("value1", nil), | ||||||
| ("value2", nil), | ||||||
| ]) | ||||||
| func contextualArrayLiteral(x: String?, y: Int?) {} | ||||||
|
|
||||||
| @Test(.hidden, arguments: ["value": 123]) | ||||||
| func twoDictionaryElementParameters(x: String, y: Int) {} | ||||||
|
|
||||||
| @Test(.hidden, arguments: ["value": 123]) | ||||||
| func oneDictionaryElementTupleParameter(x: (key: String, value: Int)) {} | ||||||
|
|
||||||
| @Test<KeyValuePairs<String, Int?>>(.hidden, arguments: [ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Generic parameters on |
||||||
| "value1": nil, | ||||||
| "value2": 123, | ||||||
| ]) | ||||||
| func contextualDictionaryLiteral(key: String, value: Int?) {} | ||||||
|
|
||||||
| @Test(.disabled(), arguments: [1, 2, 3]) func disabled(x: Int) {} | ||||||
| } | ||||||
Uh oh!
There was an error while loading. Please reload this page.