TypeScript Version: 3.6.2
Search Terms:
Code
type A = {first: string};
type B = {second: string};
function test(props: A&B &A) {
}
Expected behavior:
Should throw error cause A is used multiple times in type definition of props
Actual behavior:
No error is thrown
Playground Link:
Related Issues:
Intersection is idempotent, so flagging an error here would be incorrect.
If anything, this would be more suitable as a lint rule, IMO.
Most helpful comment
Intersection is idempotent, so flagging an error here would be incorrect.
If anything, this would be more suitable as a lint rule, IMO.