Fixes #679: @specialize with invalid attribute #710
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This closes #679.
The solution suggests that the
@_specialize
parameter is missing a colon (i.e.Expected ':' in attribute argument
). This is only true for parameters ofSpecializeParameter
enum.However, I believe this behaviour is incorrect in case of supplying a type as a parameter (E.g.
@_specialize(T == Int)
), because it won't have a colon.The previous example is from
@_specialize
attribute pitch, where it seems it's possible to define a parameter with a type only, as opposed to the current unit tests inSwiftParserTest
where the type parameters are only defined with awhere
clause (E.g.@_specialize(where T.Element == Int)
).So I'm not 100% sure about the possibility of supplying the type only without a
where
clause.