-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Unrelated interface causes assignability to change #56099
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
Comments
Bisects to #53396, cc @ahejlsberg . Trying to find a more direct repro that involves only a single assignability check, but I suspect the self-reference in Edit to add: Adding variance annotations doesn't help. |
Several interesting things going on here. The following declare let c: Collection<never>;
declare let m: Map<never>;
c = m; // Error reports the error
That's surprising, particularly since the Now, there's something very fishy about the Anyway, the But why does I'm going to think about possible fixes. We should probably discuss in our next design meeting. |
π Search Terms
5.3 regression
π Version & Regression Information
β― Playground Link
Playground Link
π» Code
π Actual behavior
R is
unknown
. RemovingKeyed
makesR
"NO"
, even thoughKeyed
is unused otherwise.π Expected behavior
Not really sure. I'd settle for the stable 5.2 behavior, which is for
R
to be"NO"
although that also seems wrong (Why doesn'tMap<never> extends Collection
? If we removeflatMap(): Collection<V>
fromCollection
thenMap<never>
extendsCollection
. This seems like the correct behavior.)Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: