-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
A value of type X cannot be used to initialize an entity of type X #3212
Comments
I'm able to repro the bug. It's a bug inherited from VS. I normally would create a bug on VS myself, but they've asked us to have users to report it themselves at https://developercommunity.visualstudio.com/content/problem/post.html?space=62 -- simply pasting a link to this bug report would be good enough. If that is too much of a burden for you, let me know, and I'll open the bug myself. |
@sean-mcmanus hi thanks for your feedback! However it requires an MS account but I don't have one and don't intend to create one at the moment... |
I filed a VS bug https://developercommunity.visualstudio.com/content/problem/471939/c-intellisense-incorrectly-show-a-value-of-type-x.html . But it sounds like they want more upvotes before they'll fix it. |
Looks like this was already reported in July (from the Stack Overflow): https://developercommunity.visualstudio.com/content/problem/293884/e0144-being-reported-for-valid-code-intellisense-e.html . It needs more upvotes. |
encountered the same issue |
@stcheng Are you able to upvote the VS issue at https://developercommunity.visualstudio.com/content/problem/293884/e0144-being-reported-for-valid-code-intellisense-e.html ? Or if enough people can upvote this GitHub issue we may be able to get them to re-open it. |
Just hit this myself. |
Annoying problem - please fix. |
To suppress this error, you can add
to some code in the TU, such as in a forcedInclude:
Starting with https://github.com/microsoft/vscode-cpptools/releases/tag/0.30.0-insiders4, the error codes are added to the IntelliSense errors, so other invalid errors can be suppressed as well. |
Still seeing this same error, in addition to error 513 which is the same but states, "a value of type X cannot be assigned to an entity of type X". |
@sean-mcmanus They have closed the issue, which also blocks voting and commenting on the issue. I really dislike developercommunity.visualstudio.com, it feels futile to report issues. It used to be better in the past (when they used Connect). |
@HermanEldering I have re-activated the internal ticket so you can upvote now -- looks like the issue got mistakenly dup'd to a different issue with the same error message involving enums. |
Same behavior on VS 2019 latest version.
|
This needs to be fixed ASAP. |
@vaggelanos @antisocrates It should be fixed after we update our VS parser for 1.4.0-insiders (no date available yet). |
Super great, thanks for the works! |
Type: LanguageService
Describe the bug
To Reproduce
Expected behavior
This is a legitimate assignment and there should not be an error.
Screenshots
other info:
Might related to this on StackOverflow, though it's not clear whether the problem described in that post occurred in VSCode or other IDE/editor.
The text was updated successfully, but these errors were encountered: