-
Notifications
You must be signed in to change notification settings - Fork 793
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
Don't print the declaring type for RQA union cases #10083
Conversation
Now that this is considered a regression, I propose to merge this into the VS 16.7.x branch as well and not just into future branches, since otherwise we may keep seeing reports on this cropping up until long term support is over. |
We'll see if there are reports. We generally avoid servicing unless it is absolutely necessary, and VS telemetry shows that users overwhelmingly update instead of stay on older versions, even if it's technically marked LTS. |
I think we should be more nuanced here
Technically separating 1/2 from 3 is simple. Separating 1 from 2/3 is a little harder (it needs another flag passed through to printf in the format string, the only way to plumb such flags through). |
I'd be fine with that I suppose. Note that the same nuance should probably apply for enums, especially when you consider that they need to be fully qualified anyways. Though that gets even more tricky if you consider |
Note that enum values, other than DU cases, have a clear string representation: the case name only. In FSI, they are currently represented in the default output a little bit different than other types, but in regular programming with > type MyEnum = One = 1 | Two = 2;;
type MyEnum =
| One = 1
| Two = 2
> MyEnum.One;;
val it : MyEnum = One {value__ = 1;}
> string MyEnum.One;;
val it : string = "One"
> sprintf "%A" MyEnum.One;;
val it : string = "One" And with > open type MyEnum;;
> One;;
val it : MyEnum = One {value__ = 1;}
> MyEnum.One;;
val it : MyEnum = One {value__ = 1;} |
@dsyme I think we can tweak that later. But right now I just want to get this in so that we don't ship the regression by release. |
ok |
fixes #9357
Unfortunately, both
%A
and%s
do the same thing for union cases, so if anyone is relying on stringifying a union case for anything they can't switch to a "better" way unless they overrideToString()
.Ideally people would not rely on this, since the prupose of this functionality is to provide structured plaintext output in tools. But the reality is that it is being used for more than that.