-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Invalid metadata emitted for a System.ValueTuple type #43595
Comments
cc @jcouv |
That one is expected and covered by existing tests. The type is recognized as a tuple and therefore has tuple elements. |
I don't think so. The fields are not declared and shouldn't appear out of thin air.
Doesn't make the behavior correct. |
That certainly wasn't a behavior prior to #39370 and the Symbol Model change was not supposed to change behavior. Also, the fact that it not By Design can be observed by compiling the following code:
Observed:
As we can see, the fields do not exist, even compiler thinks that. And that is expected and always worked this way. |
I understand it was not the prior behavior, because then |
We are talking about undeclared fields not about our view on types themselves. One has nothing to do with another and fields just aren't becoming declared because of that. I agree the behavior is a fall out of the implementation work with intent to change how we represent tuple types, but we didn't want that kind of change in behavior, it is not unavoidable (even with the new view on the types) and this is just an oversight. I think this is a bad change, obviously inconsistent with overall compiler's behavior around missing declarations in tuples. We are emitting error fields. The symbols are TupleErrorFieldSymbols. They have a use-site error associated with them. They are created for the purpose of reporting the errors. That is the intent behind them and I see no indication of intent to emit them. The current behavior simply doesn't connect with other pieces of the "puzzle". I also do not remember any discussions around that change. |
Observed:
Note, declaration of two public fields that appeared from nowhere.
The text was updated successfully, but these errors were encountered: