-
Notifications
You must be signed in to change notification settings - Fork 767
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
Embedded class is incorrectly recognized as Unknown
under particular conditions
#2157
Comments
Thanks for the bug report. This occurs only when This will be fixed in the next release. |
This issue has been fixed in version 2021.12.1, which we've just released. You can find the changelog here: CHANGELOG.md |
Is the fix not published yet? For this issue was found in 2021.12.1 and I haven't see a new version of 2021.12.2 in case there's a typo. |
This was fixed after Pylance 2021.12.1 was released. |
Are you talking about 2021.12.2 instead of 2021.12.1? 2021.12.1 is just the version of Pylance which the issue was found in. |
@Azureblade3808, the fix will be in Pylance version 2021.12.2 which will be released next week. (Typically we publish Pylance on Wednesday or Thursday.) @bschnurr, it looks like you closed this bug after publishing 2021.12.1, but this fix was introduced afterward. It's included in Pyright 1.1.195. |
Sorry about that. New Pylance version 2021.12.2 was just released. |
Environment data
Sample code
Expected behavior
Every type is correctly recognized.
Actual behavior
When you hover on an embedded part (e.g.
B
orC
inA.B.C
) of the result types ofb0
,c0
,A.b
andA.c
, you will find that it is recognized asUnknown
.b1
andc1
are OK.All become right once the last lines are recovered from being commented out.For the last several commented lines, if you uncomment a line, the result type of the corresponding function / method SOMETIMES becomes right, while I didn't find a way to ensure that.
And to my surprise, this issue only exists for return types, but not argument types.
Edit:
Change the description of uncommenting the last several lines.
The text was updated successfully, but these errors were encountered: