mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 02:30:15 -06:00
Remove check about ctors returning object types -- it isn't useful
This commit is contained in:
parent
ddd78fb609
commit
06f766ce44
@ -7196,12 +7196,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
// Check that the constructor/factory returns an object type
|
||||
let returnType = getUnionType(signatures.map(s => getReturnTypeOfSignature(s)));
|
||||
if (!isTypeAny(returnType) && !(returnType.flags & TypeFlags.ObjectType)) {
|
||||
error(node.tagName, Diagnostics.The_return_type_of_a_JSX_element_constructor_must_return_an_object_type);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Issue an error if this return type isn't assignable to JSX.ElementClass
|
||||
let elemClassType = getJsxGlobalElementClassType();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user