mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
30 lines
591 B
TypeScript
30 lines
591 B
TypeScript
//// [tests/cases/conformance/jsx/tsxAttributeResolution2.tsx] ////
|
|
|
|
//// [file.tsx]
|
|
declare namespace 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'
|
|
|
|
|
|
//// [file.jsx]
|
|
"use strict";
|
|
// 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'
|