// @filename: file.tsx // @jsx: preserve // @module: amd // @noLib: true // @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react') export interface ClickableProps { children?: string; className?: string; } export interface ButtonProps extends ClickableProps { onClick: React.MouseEventHandler; } export interface LinkProps extends ClickableProps { to: string; } export interface HyphenProps extends ClickableProps { "data-format": string; } let obj = { children: "hi", to: "boo" } let obj1: any; let obj2 = { onClick: () => {} } export function MainButton(buttonProps: ButtonProps): JSX.Element; export function MainButton(linkProps: LinkProps): JSX.Element; export function MainButton(hyphenProps: HyphenProps): JSX.Element; export function MainButton(props: ButtonProps | LinkProps | HyphenProps): JSX.Element { const linkProps = props as LinkProps; if(linkProps.to) { return this._buildMainLink(props); } return this._buildMainButton(props); } // OK const b0 = GO; const b1 = {}}>Hello world; const b2 = ; const b3 = ; const b4 = ; // any; just pick the first overload const b5 = ; // should pick the second overload const b6 = ; const b7 = { console.log("hi") }}} />; const b8 = ; // OK; method declaration get retained (See GitHub #13365) const b9 = GO; const b10 = ; const b11 = {}} className="hello" data-format>Hello world; const b12 =