-
Notifications
You must be signed in to change notification settings - Fork 790
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
Allow generic attributes #14714
Allow generic attributes #14714
Conversation
Amazing! |
LessRange: range option | ||
|
||
TypeArgs: SynType list | ||
|
||
CommaRanges: range list | ||
|
||
GreaterRange: range option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like a Trivia
node that @nojaf might have opinions on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, SynType.App
, SynType.LongIdentApp
and SynExpr.TypeApp
use those 3 range fields too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SynType.App, SynType.LongIdentApp and SynExpr.TypeApp
pre-date SynTrivia
, I think for a new concept it make sense to have these as trivia.
It might also make sense to introduce a new type for TypeName : SynLongIdent
.
fsharp/src/Compiler/TypedTree/TypedTree.fsi Lines 3102 to 3106 in fd6eb11
This is a problem since we're working with Ah, and most importantly, typed tree pickling works with attribute tycons. I'm also currently forced to do |
/// The syntax range of the LESS symbol | ||
LessRange: range option | ||
|
||
/// Type arguments | ||
TypeArgs: SynType list | ||
|
||
/// Ranges of the commas between type arguments | ||
CommaRanges: range list | ||
|
||
/// The syntax range of the GREATER symbol | ||
GreaterRange: range option | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to duplicate info from SynType.App
, SynType.LongIdentApp
and SynExpr.TypeApp
. Maybe we could extract these field into a separate type, like SynTypeArgumentList
or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the question is whether we extract all 4 as SynTypeArgumentList
or just the ranges as SynTypeArgumentTrivia
, or
type SynTypeArgumentTrivia = {
LessRange: range option
CommaRanges: range list
GreaterRange: range option
}
type SynTypeArgumentList = {
TypeArgs: SynType list
Trivia: SynTypeArgumentTrivia
}
Implements fsharp/fslang-suggestions#965.