-
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
Type inference returns a type different from the declared type. #1802
Comments
Are you seeing a behavior that leads to a false positive or false negative type error, or are you just curious about the behavior you're seeing? If you are seeing an actual bug, please provide a sample that demonstrates the problem. If you're just curious, then posting a question in the discussion section would be more appropriate. |
I see this as a false positive type error. I have only given it the type So it contradicts the next sentence.
The I can't indicate the problem any further, and I'm not interested in it, so if it's not a problem, please close it. kind regards. |
I agree that this is an inconsistency. I investigated and found the root cause. This inconsistency will be eliminated in the next release. |
Thank you! |
This issue has been fixed in version 2021.9.2, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202192-16-september-2021 |
In the following example,
passing
func3
will returnstr
instead of the declaredLiteral["running"]
.It should return the declared type as is.
The text was updated successfully, but these errors were encountered: