TypeScript/tests/cases/conformance/jsx/tsxAttributeResolution2.tsx

20 lines
365 B
TypeScript
Raw Normal View History

2015-06-18 23:03:43 +02:00
//@filename: file.tsx
//@jsx: preserve
declare module JSX {
interface Element { }
interface IntrinsicElements {
test1: Attribs1;
}
}
interface Attribs1 {
c1?: (x: string) => void;
}
// OK
<test1 c1={(x) => x.length} />; // OK
<test1 data-c1={(x) => x.leng} />; // OK
// Errors
<test1 c1={(x) => x.leng} />; // Error, no leng on 'string'