@@ -39,6 +39,16 @@ amb = { tag: "A", y: 12, extra: 12 }
3939// the last constituent since assignability error reporting can't find a single best discriminant either.
4040amb = { tag : "A" }
4141amb = { tag : "A" , z : true }
42+
43+ type Overlapping =
44+ | { a : 1 , b : 1 , first : string }
45+ | { a : 2 , second : string }
46+ | { b : 3 , third : string }
47+ let over : Overlapping
48+
49+ // these two are not reported because there are two discriminant properties
50+ over = { a : 1 , b : 1 , first : "ok" , second : "error" }
51+ over = { a : 1 , b : 1 , first : "ok" , third : "error" }
4252
4353
4454//// [excessPropertyCheckWithUnions.js]
@@ -58,3 +68,7 @@ amb = { tag: "A", y: 12, extra: 12 };
5868// the last constituent since assignability error reporting can't find a single best discriminant either.
5969amb = { tag : "A" } ;
6070amb = { tag : "A" , z : true } ;
71+ var over ;
72+ // these two are not reported because there are two discriminant properties
73+ over = { a : 1 , b : 1 , first : "ok" , second : "error" } ;
74+ over = { a : 1 , b : 1 , first : "ok" , third : "error" } ;
0 commit comments