In code below constructing generic jsx element el1 works in 2.8.3, but breaks on 2.9.0-dev.20180512. Constructing el2 in 2.9.0-dev.20180512 works fine - shouldn't these be completely equivalent?
TypeScript Version: 2.9.0-dev.20180512
Search Terms: jsx conditional
Code
typeFunctionPropertyNames<T>={[KinkeyofT]: T[K]extendsFunction ? K : never}[keyofT];classTestObject{a: string='';b: number=1;c: ()=>void=()=>{};}interfaceTestProps<T>{model: T;foo: FunctionPropertyNames<T>;}functionTest<T>(props: TestProps<T>){return<></>;}constmodel=newTestObject();constel1=<Testmodel={model}foo="c"/>;constel2=<Test<TestObject>model={model}foo="c"/>;Expected behavior:
Compilation passes without errors.
Actual behavior:
test.tsx:14:33 - error TS2326: Types of property 'foo' are incompatible.
Type 'string' is not assignable to type '"c"'.
14 const el1 = <Test model={model} foo="c" />;
~~~~~~~
Playground Link:
n/a since playground doesn't support jsx
Related Issues:
Possibly related to #23724
In code below constructing generic jsx element
el1works in 2.8.3, but breaks on2.9.0-dev.20180512. Constructingel2in2.9.0-dev.20180512works fine - shouldn't these be completely equivalent?TypeScript Version: 2.9.0-dev.20180512
Search Terms: jsx conditional
Code
Expected behavior:
Compilation passes without errors.
Actual behavior:
Playground Link:
n/a since playground doesn't support jsx
Related Issues:
Possibly related to #23724