TypeScript/tests/cases/fourslash/tsxGoToDefinitionUnionElementType1.ts
Wesley Wigham 08022d57c8
Allow calls on unions of dissimilar signatures (#29011)
* Add core of new union signature logic and test - needs intersection signature logic to fully work

* Add inversion of variance for class props lookup from union sig returns

* Fix lints

* Combine parameter names for nicer quick info

* PR feedback 1

* Fix miscopy

* PR feedback round 2

* Remove argument name combining because loc :(

* Nit cleanup round 3

* Reinline getTupleTypeForArgumentAtPos

* Remove a tad more

* No step on sneky off-by-one error
2018-12-19 16:35:01 -08:00

27 lines
598 B
TypeScript

/// <reference path='fourslash.ts' />
//@Filename: file.tsx
// @jsx: preserve
// @noLib: true
//// declare module JSX {
//// interface Element { }
//// interface IntrinsicElements {
//// }
//// interface ElementAttributesProperty { props; }
//// }
//// function /*pt1*/SFC1(prop: { x: number }) {
//// return <div>hello </div>;
//// };
//// function SFC2(prop: { x: boolean }) {
//// return <h1>World </h1>;
//// }
//// var /*def*/SFCComp = SFC1 || SFC2;
//// <[|SFC/*one*/Comp|] x />
verify.goToDefinition({
"one": ["def", "pt1"],
});