Skip to content

Commit 1e3625c

Browse files
committed
Accept new baselines
1 parent b687d90 commit 1e3625c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
error TS2318: Cannot find global type 'CallableFunction'.
2+
error TS2318: Cannot find global type 'NewableFunction'.
3+
4+
5+
!!! error TS2318: Cannot find global type 'CallableFunction'.
6+
!!! error TS2318: Cannot find global type 'NewableFunction'.
7+
==== tests/cases/compiler/booleanLiteralsContextuallyTypedFromUnion.tsx (0 errors) ====
8+
interface A { isIt: true; text: string; }
9+
interface B { isIt: false; value: number; }
10+
type C = A | B;
11+
const isIt = Math.random() > 0.5;
12+
const c: C = isIt ? { isIt, text: 'hey' } : { isIt, value: 123 };
13+
const cc: C = isIt ? { isIt: isIt, text: 'hey' } : { isIt: isIt, value: 123 };
14+
15+
type ComponentProps =
16+
| {
17+
optionalBool: true;
18+
mandatoryFn: () => void;
19+
}
20+
| {
21+
optionalBool: false;
22+
};
23+
24+
let Funk = (_props: ComponentProps) => <div>Hello</div>;
25+
26+
let Fail1 = () => <Funk mandatoryFn={() => { }} optionalBool={true} />
27+
let Fail2 = () => <Funk mandatoryFn={() => { }} optionalBool={true as true} />
28+
let True = true as true;
29+
let Fail3 = () => <Funk mandatoryFn={() => { }} optionalBool={True} />
30+
let attrs2 = { optionalBool: true as true, mandatoryFn: () => { } }
31+
let Success = () => <Funk {...attrs2} />

0 commit comments

Comments
 (0)