-
Notifications
You must be signed in to change notification settings - Fork 28
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
No bounds if type param present #885
No bounds if type param present #885
Conversation
…ant, or `Never` if it's contravariant
…hether to use variance to specialize type vars when narrowing
awesome thanks! will take a look at this later today. i assumed the fix would be very difficult but i guess it was something simple i was missing do you mind removing the upstream commits? i only do upstream merges when there's a new release. or if it's too much of a hassle i can do that myself |
I think I only pulled from basedpyright main, not from pyright. Your branch in #745 was a month old. |
ah i see, all good then |
82d3320
to
7f1d22e
Compare
i've cherrypicked your commits into #745 and rebased onto main. the primer identified an issue with constrained typevars (#745 (comment)). i dont think it'd be too hard to fix, i'll try to look into it within the next couple days, but if you'd rather give it a go feel free thanks again for the help! |
9a3e3d1
to
1a71f1d
Compare
closing this since i've merged your commits into #745 and fixed the issue with constraints |
This is a pull request onto the narrowing generics branch, not onto main.
And I've pulled from current main here, so if you pull from main on that target branch, it will clean up the diff here.
This fixes the test case that was failing, and also #745 (comment) (which were really the same issue).
And also changes to use this new narrowing on
Any
andUnknown
as discussed in #745 (comment)It also adds a few more test cases.