Closed as not planned
Description
🔎 Search Terms
"constraint", "method declaration"
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about "A method and a function property of the same type behave differently"
⏯ Playground Link
💻 Code
interface A<T> {
foo<U extends T>(x: U): any
}
function f0(a: A<string>, b: A<number>) {
b = a // should report error but actually not.
b.foo(1) // unsound
}
🙁 Actual behavior
check success
🙂 Expected behavior
b = a
report number
cannot assign to string
.
Additional information about the issue
No response