-
Notifications
You must be signed in to change notification settings - Fork 789
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
Provide a mechanism for pinning type signatures formats during printing #10744
Conversation
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.
Formatting changes. Note that NicePrint is also used to print signatures. So some tests might fail because of that and the sig printing would have to be adjusted to match the current behavior.
@@ -2796,7 +2802,8 @@ type DisplayEnv = | |||
printVerboseSignatures = false | |||
g = tcGlobals | |||
contextAccessibility = taccessPublic | |||
generatedValueLayout = (fun _ -> None) } | |||
generatedValueLayout = (fun _ -> None) | |||
genericParameterStyle = GenericParameterStyle.Implicit } |
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.
Is this the correct default?
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 preserves the behavior currently, which is to print based on the state of the flag on the TyCon.
I could see a future FCS release where we say 'nah let's just go for Prefix by default' and we'd change it here, though.
Co-authored-by: Phillip Carter <[email protected]>
Co-authored-by: Phillip Carter <[email protected]>
I would very much be surprised if any logic tests failed, as I intended to make this feature opt-in entirely. Surface area tests I do expect to fail. |
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.
Nice, thank you.
…ng (dotnet#10744) Co-authored-by: Phillip Carter <[email protected]>
In FSAC we have some pretty convoluted logic for undoing the compiler's default printing of generic type parameters for types that use the suffix form (ie
int list
).We'd love a way to explicit ask NicePrint to render the type signature in a given way, either prefix or suffix, regardless of the derived flag on the type itself.
To that end, this PR: