-
Notifications
You must be signed in to change notification settings - Fork 832
Always emit conditional attributes in FCS #6004
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
Conversation
|
#3890 indicated that there would be an option to enable or disable this. I'm not sure Don's comment covered the #if COMPILER_PUBLIC_API option. Is it possible that tools developed with the FCS would want it both ways. Or is it possible, that there are no FCS scenarios that want the attributed erased? Thanks Kevin |
|
@KevinRansom If I got it correctly Don didn't mind always emitting it in the service, which was another proposed way.
I couldn't think of scenarios where FCS clients would want attributes erased. If there're such scenarios I'll change it to using an option. |
I now think we should use a flag. FCS can be used for compilation and may in the future be used as the basis for implementing |
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.
Can we add a switch pls.
|
@dsyme @KevinRansom Sure, done. |
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.
looks good.
Thank you
|
I kinda of don't like adding a specific switch for this. Why not have a switch to indicate we are running in tooling mode or compilation (fsc) mode? |
| /// The set of active conditional defines | ||
| conditionalDefines: string list | ||
| /// The set of active conditional defines. The value is None when conditional erasure is disabled in tooling. | ||
| conditionalDefines: string list 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.
I'm not a fan of list option types as I usually get confused by what it could mean. The comment does help though, so it's not a mystery. Though, I prefer another bool field honestly. What you think?
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.
I think I'm okay with this.
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.
Why are you ok with it? (Just curious because I'm on the fence).
The more I think about it, the more I really want a new bool field i.e isConditionalErasureEnabled : bool. Nothing can be clearer than that especially when it's used in code.
Using an option gives the field conditionalDefines more responsibility.
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.
@TIHan On the other hand using option makes one aware of situation when there may be no conditional erasure unlike a separate field that one may be unaware of.
Fixes #3890. We analyse conditionally erased attributes like
CanBeNullorNotNullfromJetBrains.Annotationspackage and need to see all attributes before erasure. Any objections to always doing it in the compiler service?