//// [tests/cases/compiler/discriminableUnionWithIntersectedMembers.ts] ////

//// [discriminableUnionWithIntersectedMembers.ts]
// regression test for https://github.com/microsoft/TypeScript/issues/33243
type X = 
 | { x: 'x', y: number } & { y: number } 
 | { x: 'y', y: number, z?: boolean } & { y: number }

// error
const x: X = 4 as any as { x: 'x' | 'y', y: number };

type Y = 
 | { x: 'x', y: number } 
 | { x: 'y', y: number, z?: boolean }

// no  error
const y: Y = 4 as any as { x: 'x' | 'y', y: number };

//// [discriminableUnionWithIntersectedMembers.js]
"use strict";
// error
const x = 4;
// no  error
const y = 4;
