-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
GetTypeInfo
returns TypeInfo
with null as Type
for ImplicitObjectCreationExpression
inside CollectionExpression
#70041
Comments
This is correct, an implicit objet has no type on it's own. it needs a target type it is converted to to actually determine what type it is. Check TypeInfo.ConvertedType instead. |
@CyrusNajmabadi Also, what I would like to mention is that Type is not null for
I expect the behaviour to be the same for both calls. |
IDK if you will get the notification @CyrusNajmabadi since the issue is closed. |
reactivating for compiler investigation. |
This was fixed as part of #69852 which includes multiple tests verifying that:
|
Out of curiosity, can you tell me why |
Hello @jcouv, I tested with the latest preview version of Visual Studio (Preview 5) and am still facing the same issue. Is the fix in #69852 has been released yet? |
Version Used:
Steps to Reproduce:
Call semanticModel.GetTypeInfo for the
ImplicitObjectCreationExpression
from the snippet below.Expected Behavior:
The type should be correctly retrieved.
Actual Behavior:
The type is null.
The text was updated successfully, but these errors were encountered: