From 06f766ce447ec682fa45f87ae5bd099f07ec6eff Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Wed, 22 Jul 2015 09:27:57 -0700 Subject: [PATCH] Remove check about ctors returning object types -- it isn't useful --- src/compiler/checker.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5fee3dd3a54..0cd41a2a02b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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();