diff --git a/package.json b/package.json
index 1f943f89788d6..3bf9dbcff7b54 100644
--- a/package.json
+++ b/package.json
@@ -76,7 +76,7 @@
         "travis-fold": "latest",
         "ts-node": "latest",
         "tsd": "latest",
-        "tslint": "next",
+        "tslint": "4.0.0-dev.0",
         "typescript": "next"
     },
     "scripts": {
diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts
index 902d20b0cfd3a..5b83017429979 100644
--- a/src/compiler/binder.ts
+++ b/src/compiler/binder.ts
@@ -1237,9 +1237,11 @@ namespace ts {
             const postExpressionLabel = createBranchLabel();
             bindCondition(node.condition, trueLabel, falseLabel);
             currentFlow = finishFlowLabel(trueLabel);
+            bind(node.questionToken);
             bind(node.whenTrue);
             addAntecedent(postExpressionLabel, currentFlow);
             currentFlow = finishFlowLabel(falseLabel);
+            bind(node.colonToken);
             bind(node.whenFalse);
             addAntecedent(postExpressionLabel, currentFlow);
             currentFlow = finishFlowLabel(postExpressionLabel);
@@ -1297,6 +1299,7 @@ namespace ts {
                 case SyntaxKind.TypeLiteral:
                 case SyntaxKind.JSDocTypeLiteral:
                 case SyntaxKind.JSDocRecordType:
+                case SyntaxKind.JsxAttributes:
                     return ContainerFlags.IsContainer;
 
                 case SyntaxKind.InterfaceDeclaration:
@@ -1402,6 +1405,7 @@ namespace ts {
                 case SyntaxKind.InterfaceDeclaration:
                 case SyntaxKind.JSDocRecordType:
                 case SyntaxKind.JSDocTypeLiteral:
+                case SyntaxKind.JsxAttributes:
                     // Interface/Object-types always have their children added to the 'members' of
                     // their container. They are only accessible through an instance of their
                     // container, and are never in scope otherwise (even inside the body of the
@@ -1585,6 +1589,14 @@ namespace ts {
             return bindAnonymousDeclaration(node, SymbolFlags.ObjectLiteral, "__object");
         }
 
+        function bindJsxAttributes(node: JsxAttributes) {
+            return bindAnonymousDeclaration(node, SymbolFlags.ObjectLiteral, "__jsxAttributes");
+        }
+
+        function bindJsxAttribute(node: JsxAttribute, symbolFlags: SymbolFlags, symbolExcludes: SymbolFlags) {
+            return declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes);
+        }
+
         function bindAnonymousDeclaration(node: Declaration, symbolFlags: SymbolFlags, name: string) {
             const symbol = createSymbol(symbolFlags, name);
             addDeclarationToSymbol(symbol, node, symbolFlags);
@@ -1994,6 +2006,12 @@ namespace ts {
                 case SyntaxKind.ModuleDeclaration:
                     return bindModuleDeclaration(<ModuleDeclaration>node);
 
+                // Jsx-attributes
+                case SyntaxKind.JsxAttributes:
+                    return bindJsxAttributes(<JsxAttributes>node);
+                case SyntaxKind.JsxAttribute:
+                    return bindJsxAttribute(<JsxAttribute>node, SymbolFlags.Property, SymbolFlags.PropertyExcludes);
+
                 // Imports and exports
                 case SyntaxKind.ImportEqualsDeclaration:
                 case SyntaxKind.NamespaceImport:
@@ -3050,6 +3068,7 @@ namespace ts {
             case SyntaxKind.JsxText:
             case SyntaxKind.JsxClosingElement:
             case SyntaxKind.JsxAttribute:
+            case SyntaxKind.JsxAttributes:
             case SyntaxKind.JsxSpreadAttribute:
             case SyntaxKind.JsxExpression:
                 // These nodes are Jsx syntax.
diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index 09172d02ad7e7..02a16f9ab7ba1 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -105,9 +105,14 @@ namespace ts {
             getExportsOfModule: getExportsOfModuleAsArray,
             getAmbientModules,
 
-            getJsxElementAttributesType,
+            getAllAttributesTypeFromJsxOpeningLikeElement,
             getJsxIntrinsicTagNames,
-            isOptionalParameter
+            isOptionalParameter,
+            tryFindAmbientModuleWithoutAugmentations: moduleName => {
+                // we deliberately exclude augmentations
+                // since we are only interested in declarations of the module itself
+                return tryFindAmbientModule(moduleName, /*withAugmentations*/ false);
+            }
         };
 
         const tupleTypes: GenericType[] = [];
@@ -552,7 +557,7 @@ namespace ts {
             return node.kind === SyntaxKind.SourceFile && !isExternalOrCommonJsModule(<SourceFile>node);
         }
 
-        function getSymbol(symbols: SymbolTable, name: string, meaning: SymbolFlags): Symbol {
+       function getSymbol(symbols: SymbolTable, name: string, meaning: SymbolFlags): Symbol {
             if (meaning) {
                 const symbol = symbols[name];
                 if (symbol) {
@@ -1370,16 +1375,11 @@ namespace ts {
                 return;
             }
 
-            const isRelative = isExternalModuleNameRelative(moduleName);
-            const quotedName = '"' + moduleName + '"';
-            if (!isRelative) {
-                const symbol = getSymbol(globals, quotedName, SymbolFlags.ValueModule);
-                if (symbol) {
-                    // merged symbol is module declaration symbol combined with all augmentations
-                    return getMergedSymbol(symbol);
-                }
+            const ambientModule = tryFindAmbientModule(moduleName, /*withAugmentations*/ true);
+            if (ambientModule) {
+                return ambientModule;
             }
-
+            const isRelative = isExternalModuleNameRelative(moduleName);
             const resolvedModule = getResolvedModule(getSourceFileOfNode(location), moduleReference);
             const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule);
             const sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName);
@@ -3212,6 +3212,11 @@ namespace ts {
                 const type = checkDeclarationInitializer(declaration);
                 return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality);
             }
+            else if (isJsxAttribute(declaration)) {
+                // For JSX Attribute, if it doesn't have initializer, by default the attribute gets true-type.
+                // <Elem attr /> is sugar for <Elem attr={true} />
+                return trueType;
+            }
 
             // If it is a short-hand property assignment, use the type of the identifier
             if (declaration.kind === SyntaxKind.ShorthandPropertyAssignment) {
@@ -4762,6 +4767,15 @@ namespace ts {
             }
         }
 
+        function tryFindAmbientModule(moduleName: string, withAugmentations: boolean) {
+            if (isExternalModuleNameRelative(moduleName)) {
+                return undefined;
+            }
+            const symbol = getSymbol(globals, `"${moduleName}"`, SymbolFlags.ValueModule);
+            // merged symbol is module declaration symbol combined with all augmentations
+            return symbol && withAugmentations ? getMergedSymbol(symbol) : symbol;
+        }
+
         function isOptionalParameter(node: ParameterDeclaration) {
             if (hasQuestionToken(node) || isJSDocOptionalParameter(node)) {
                 return true;
@@ -6908,6 +6922,27 @@ namespace ts {
                     }
                 }
 
+                if (target.flags & TypeFlags.TypeParameter) {
+                    // Given a type parameter K with a constraint keyof T, a type S is
+                    // assignable to K if S is assignable to keyof T.
+                    const constraint = getConstraintOfTypeParameter(<TypeParameter>target);
+                    if (constraint && constraint.flags & TypeFlags.Index) {
+                        if (result = isRelatedTo(source, constraint, reportErrors)) {
+                            return result;
+                        }
+                    }
+                }
+                else if (target.flags & TypeFlags.Index) {
+                    // Given a type parameter T with a constraint C, a type S is assignable to
+                    // keyof T if S is assignable to keyof C.
+                    const constraint = getConstraintOfTypeParameter((<IndexType>target).type);
+                    if (constraint) {
+                        if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) {
+                            return result;
+                        }
+                    }
+                }
+
                 if (source.flags & TypeFlags.TypeParameter) {
                     let constraint = getConstraintOfTypeParameter(<TypeParameter>source);
 
@@ -6986,19 +7021,24 @@ namespace ts {
             // is considered known if the object type is empty and the check is for assignability, if the object type has
             // index signatures, or if the property is actually declared in the object type. In a union or intersection
             // type, a property is considered known if it is known in any constituent type.
-            function isKnownProperty(type: Type, name: string): boolean {
+            function isKnownProperty(type: Type, name: string, isComparingJsxAttributes: boolean): boolean {
                 if (type.flags & TypeFlags.Object) {
                     const resolved = resolveStructuredTypeMembers(<ObjectType>type);
-                    if ((relation === assignableRelation || relation === comparableRelation) && (type === globalObjectType || isEmptyObjectType(resolved)) ||
-                        resolved.stringIndexInfo ||
-                        (resolved.numberIndexInfo && isNumericLiteralName(name)) ||
-                        getPropertyOfType(type, name)) {
+                    if ((relation === assignableRelation || relation === comparableRelation) &&
+                        (type === globalObjectType || isEmptyObjectType(resolved))) {
+                        return true;
+                    }
+                    else if (resolved.stringIndexInfo || (resolved.numberIndexInfo && isNumericLiteralName(name))) {
+                        return true;
+                    }
+                    else if (getPropertyOfType(type, name) || (isComparingJsxAttributes && !isUnhyphenatedJsxName(name))) {
+                        // For JSXAttributes, if the attribute has hyphenated name considered the attribute to be known
                         return true;
                     }
                 }
                 else if (type.flags & TypeFlags.UnionOrIntersection) {
                     for (const t of (<UnionOrIntersectionType>type).types) {
-                        if (isKnownProperty(t, name)) {
+                        if (isKnownProperty(t, name, isComparingJsxAttributes)) {
                             return true;
                         }
                     }
@@ -7016,16 +7056,24 @@ namespace ts {
 
             function hasExcessProperties(source: FreshObjectLiteralType, target: Type, reportErrors: boolean): boolean {
                 if (maybeTypeOfKind(target, TypeFlags.Object) && !(getObjectFlags(target) & ObjectFlags.ObjectLiteralPatternWithComputedProperties)) {
+                    const isComparingJsxAttributes = !!(source.flags & TypeFlags.JsxAttributes);
                     for (const prop of getPropertiesOfObjectType(source)) {
-                        if (!isKnownProperty(target, prop.name)) {
+                        if (!isKnownProperty(target, prop.name, isComparingJsxAttributes)) {
                             if (reportErrors) {
                                 // We know *exactly* where things went wrong when comparing the types.
                                 // Use this property as the error node as this will be more helpful in
                                 // reasoning about what went wrong.
                                 Debug.assert(!!errorNode);
-                                errorNode = prop.valueDeclaration;
-                                reportError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
-                                    symbolToString(prop), typeToString(target));
+                                if (isJsxAttributes(errorNode)) {
+                                    // JsxAttributes has an object-literal flag and is underwent same type-assignablity check as normal object-literal.
+                                    // However, using an object-literal error message will be very confusing to the users so we give different a message.
+                                    reportError(Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target));
+                                }
+                                else {
+                                    errorNode = prop.valueDeclaration;
+                                    reportError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
+                                        symbolToString(prop), typeToString(target));
+                                }
                             }
                             return true;
                         }
@@ -10497,17 +10545,24 @@ namespace ts {
         }
 
         function getContextualTypeForJsxAttribute(attribute: JsxAttribute | JsxSpreadAttribute) {
+            // When we trying to resolve JsxOpeningLikeElement as a stateless function element, we will already give JSXAttributes a contextual type
+            // which is a type of the parameter  of the signature we are trying out. This is not the case if it is a statefull Jsx (i.e ReactComponenet class)
+            // So if that is the case, just return the type of the JsxAttribute in such contextual type with out going into resolving of the JsxOpeningLikeElement again
+            if ((<JsxAttributes>attribute.parent).contextualType) {
+                return isJsxAttribute(attribute) ? getTypeOfPropertyOfType((<JsxAttributes>attribute.parent).contextualType, attribute.name.text) : undefined;
+            }
+
             const kind = attribute.kind;
-            const jsxElement = attribute.parent as JsxOpeningLikeElement;
-            const attrsType = getJsxElementAttributesType(jsxElement);
+            const jsxElement = attribute.parent.parent as JsxOpeningLikeElement;
+            const attrsType = getAttributesTypeFromJsxOpeningLikeElement(jsxElement);
 
-            if (attribute.kind === SyntaxKind.JsxAttribute) {
+            if (kind === SyntaxKind.JsxAttribute) {
                 if (!attrsType || isTypeAny(attrsType)) {
                     return undefined;
                 }
                 return getTypeOfPropertyOfType(attrsType, (attribute as JsxAttribute).name.text);
             }
-            else if (attribute.kind === SyntaxKind.JsxSpreadAttribute) {
+            else if (kind === SyntaxKind.JsxSpreadAttribute) {
                 return attrsType;
             }
 
@@ -10584,6 +10639,9 @@ namespace ts {
                 case SyntaxKind.JsxAttribute:
                 case SyntaxKind.JsxSpreadAttribute:
                     return getContextualTypeForJsxAttribute(<JsxAttribute | JsxSpreadAttribute>parent);
+                case SyntaxKind.JsxOpeningElement:
+                case SyntaxKind.JsxSelfClosingElement:
+                    return getAttributesTypeFromJsxOpeningLikeElement(<JsxOpeningLikeElement>parent);
             }
             return undefined;
         }
@@ -11069,66 +11127,145 @@ namespace ts {
             }
         }
 
-        function checkJsxAttribute(node: JsxAttribute, elementAttributesType: Type, nameTable: Map<boolean>) {
-            let correspondingPropType: Type = undefined;
-
-            // Look up the corresponding property for this attribute
-            if (elementAttributesType === emptyObjectType && isUnhyphenatedJsxName(node.name.text)) {
-                // If there is no 'props' property, you may not have non-"data-" attributes
-                error(node.parent, Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, getJsxElementPropertiesName());
-            }
-            else if (elementAttributesType && !isTypeAny(elementAttributesType)) {
-                const correspondingPropSymbol = getPropertyOfType(elementAttributesType, node.name.text);
-                correspondingPropType = correspondingPropSymbol && getTypeOfSymbol(correspondingPropSymbol);
-                if (isUnhyphenatedJsxName(node.name.text)) {
-                    const attributeType = getTypeOfPropertyOfType(elementAttributesType, getTextOfPropertyName(node.name)) || getIndexTypeOfType(elementAttributesType, IndexKind.String);
-                    if (attributeType) {
-                        correspondingPropType = attributeType;
+        /**
+         * Get attributes symbol of the given Jsx opening-like element. The result is from resolving "attributes" property of the opening-like element.
+         * @param openingLikeElement a Jsx opening-like element
+         * @return a symbol table resulted from resolving "attributes" property or undefined if any of the attribute resolved to any or there is no attributes.
+         */
+        function getJsxAttributesSymbolArrayFromAttributesProperty(openingLikeElement: JsxOpeningLikeElement): Symbol[] | undefined {
+            const attributes = openingLikeElement.attributes;
+            let attributesTable = createMap<Symbol>();
+            let spread: Type = emptyObjectType
+            let attributesArray: Symbol[] = [];
+            for (const attributeDecl of attributes.properties) {
+                const member = attributeDecl.symbol;
+                if (isJsxAttribute(attributeDecl)) {
+                    let exprType: Type;
+                    if (attributeDecl.initializer) {
+                        exprType = checkExpression(attributeDecl.initializer);
                     }
                     else {
-                        // If there's no corresponding property with this name, error
-                        if (!correspondingPropType) {
-                            error(node.name, Diagnostics.Property_0_does_not_exist_on_type_1, node.name.text, typeToString(elementAttributesType));
-                            return unknownType;
-                        }
+                        // <Elem attr /> is sugar for <Elem attr={true} />
+                        exprType = trueType;
+                    }
+
+                    const attributeSymbol = <TransientSymbol>createSymbol(SymbolFlags.Property | SymbolFlags.Transient | member.flags, member.name);
+                    attributeSymbol.declarations = member.declarations;
+                    attributeSymbol.parent = member.parent;
+                    if (member.valueDeclaration) {
+                        attributeSymbol.valueDeclaration = member.valueDeclaration;
                     }
+                    attributeSymbol.type = exprType;
+                    attributeSymbol.target = member;
+                    attributesTable[attributeSymbol.name] = attributeSymbol;
+                    attributesArray.push(attributeSymbol);
+                }
+                else {
+                    Debug.assert(attributeDecl.kind === SyntaxKind.JsxSpreadAttribute);
+                    if (attributesArray.length > 0) {
+                        spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable), attributes.symbol);
+                        attributesArray = [];
+                        attributesTable = createMap<Symbol>();
+                    }
+                    const exprType = checkExpression(attributeDecl.expression);
+                    const widenExprType = getWidenedType(exprType);
+                    if (!(widenExprType.flags & (TypeFlags.Object | TypeFlags.Any))) {
+                        error(attributeDecl, Diagnostics.Spread_types_may_only_be_created_from_object_types);
+                        return undefined;
+                    }
+                    if (isTypeAny(widenExprType)) {
+                        return undefined;
+                    }
+                    spread = getSpreadType(spread, exprType, attributes.symbol);
                 }
             }
 
-            let exprType: Type;
-            if (node.initializer) {
-                exprType = checkExpression(node.initializer);
-            }
-            else {
-                // <Elem attr /> is sugar for <Elem attr={true} />
-                exprType = booleanType;
+            if (spread !== emptyObjectType) {
+                if (attributesArray.length > 0) {
+                    spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable), attributes.symbol);
+                    attributesArray = [];
+                    attributesTable = createMap<Symbol>();
+                }
+                attributesArray = getPropertiesOfType(spread);
             }
 
-            if (correspondingPropType) {
-                checkTypeAssignableTo(exprType, correspondingPropType, node);
-            }
+            return attributesArray;
+        }
 
-            nameTable[node.name.text] = true;
-            return exprType;
+        /**
+         * Create anonymous type from given attributes symbol table.
+         * @param jsxAttributesSymb a JsxAttributes node containing attributes in attributesTable
+         * @param attributesTable a symbol table of attributes property
+         */
+        function createJsxAttributesType(jsxAttributesSymb: Symbol, attributesTable: Map<Symbol>) {
+            const result = createAnonymousType(jsxAttributesSymb, attributesTable, emptyArray, emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined);
+            const freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : TypeFlags.FreshLiteral;
+            result.flags |= TypeFlags.JsxAttributes | TypeFlags.ContainsObjectLiteral | freshObjectLiteralFlag;
+            result.objectFlags |= ObjectFlags.ObjectLiteral;
+            return result;
         }
 
-        function checkJsxSpreadAttribute(node: JsxSpreadAttribute, elementAttributesType: Type, nameTable: Map<boolean>) {
-            const type = checkExpression(node.expression);
-            const props = getPropertiesOfType(type);
-            for (const prop of props) {
-                // Is there a corresponding property in the element attributes type? Skip checking of properties
-                // that have already been assigned to, as these are not actually pushed into the resulting type
-                if (!nameTable[prop.name]) {
-                    const targetPropSym = getPropertyOfType(elementAttributesType, prop.name);
-                    if (targetPropSym) {
-                        const msg = chainDiagnosticMessages(undefined, Diagnostics.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property, prop.name);
-                        checkTypeAssignableTo(getTypeOfSymbol(prop), getTypeOfSymbol(targetPropSym), node, undefined, msg);
+        /**
+         * Check JSXAttributes. This function is used when we are trying to figure out call signature for JSX opening-like element.
+         * In "checkApplicableSignatureForJsxOpeningLikeElement", we get type of arguments by checking the JSX opening-like element attributes property with contextual type.
+         * @param node a JSXAttributes to be resolved of its typea
+         */
+        function checkJsxAttributes(node: JsxAttributes) {
+            const symbolArray = getJsxAttributesSymbolArrayFromAttributesProperty(node.parent as JsxOpeningLikeElement);
+            let argAttributesType = anyType as Type;
+            if (symbolArray) {
+                const symbolTable = createMap<Symbol>();
+                forEach(symbolArray, (attr) => {
+                    symbolTable[attr.name] = attr;
+                });
+                argAttributesType = createJsxAttributesType(node.symbol, symbolTable);
+            }
+            return argAttributesType;
+        }
+
+        /**
+         * Check whether the given attributes of JsxOpeningLikeElement is assignable to its corresponding tag-name attributes type.
+         *      Resolve the type of attributes of the openingLikeElement through checking type of tag-name
+         *      Check assignablity between given attributes property, "attributes" and the target attributes resulted from resolving tag-name
+         * @param openingLikeElement an opening-like JSX element to check its JSXAttributes
+         */
+        function checkJSXAttributesAssignableToTagnameAttributes(openingLikeElement: JsxOpeningLikeElement) {
+            let targetAttributesType: Type;
+            // targetAttributesType is a type of an attributes from resolving tagnmae of an opening-like JSX element.
+            if (isJsxIntrinsicIdentifier(openingLikeElement.tagName)) {
+                targetAttributesType = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(openingLikeElement);
+            }
+            else {
+                targetAttributesType = getCustomJsxElementAttributesType(openingLikeElement);
+            }
+
+            const symbolArray = getJsxAttributesSymbolArrayFromAttributesProperty(openingLikeElement);
+            // sourceAttributesType is a type of an attributes properties.
+            // i.e <div attr1={10} attr2="string" />
+            //     attr1 and attr2 are treated as JSXAttributes attached in the JsxOpeningLikeElement as "attributes". They resolved to be sourceAttributesType.
+            let sourceAttributesType = anyType as Type;
+            let isSourceAttributesTypeEmpty = true;
+            if (symbolArray) {
+                // Filter out any hyphenated names as those are not play any role in type-checking unless there are corresponding properties in the target type
+                const symbolTable = createMap<Symbol>();
+                forEach(symbolArray, (attr) => {
+                    if (isUnhyphenatedJsxName(attr.name) || getPropertyOfType(targetAttributesType, attr.name)) {
+                        symbolTable[attr.name] = attr;
+                        isSourceAttributesTypeEmpty = false;
                     }
+                });
 
-                    nameTable[prop.name] = true;
-                }
+                sourceAttributesType = createJsxAttributesType(openingLikeElement.attributes.symbol, symbolTable);
+            }
+
+            // If the targetAttributesType is an emptyObjectType, indicating that there is no property named 'props' on this instance type.
+            // but there exists a sourceAttributesType, we need to explicitly give an error as normal assignability check allow excess properties and will pass.
+            if (targetAttributesType === emptyObjectType && !isTypeAny(sourceAttributesType) && !isSourceAttributesTypeEmpty) {
+                error(openingLikeElement, Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, getJsxElementPropertiesName());
+            }
+            else {
+                checkTypeAssignableTo(sourceAttributesType, targetAttributesType, openingLikeElement.attributes.properties.length > 0 ? openingLikeElement.attributes : openingLikeElement);
             }
-            return type;
         }
 
         function getJsxType(name: string) {
@@ -11242,29 +11379,129 @@ namespace ts {
         }
 
         /**
-         * Given React element instance type and the class type, resolve the Jsx type
-         * Pass elemType to handle individual type in the union typed element type.
+         * Get JSX attributes type by trying to resolve openingLikeElement as a stateless function component.
+         * Return only attributes type of successfully resolved call signature.
+         * This function assumes that the caller handled other possible element type of the JSX element.
+         * Unlike tryGetAllJsxStatelessFunctionAttributesType, this function is a default behavior of type-checkers.
+         * @param openingLikeElement a JSX opening-like element to find attributes type
+         * @param elementType a type of the opening-like element. This elementType can't be an union type
+         * @param elemInstanceType an element instance type (the result of newing or invoking this tag)
+         * @param elementClassType a JSX-ElementClass type. This is a result of looking up ElementClass interface in the JSX global
+         */
+        function defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement: JsxOpeningLikeElement, elementType: Type, elemInstanceType: Type, elementClassType?: Type): Type {
+            Debug.assert(!(elementType.flags & TypeFlags.Union));
+            if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) {
+                // Is this is a stateless function component? See if its single signature's return type is assignable to the JSX Element Type
+                if (jsxElementType) {
+                    // We don't call getResolvedSignature because here we have already resolve the type of JSX Element.
+                    const callSignature = getResolvedJSXStatelessFunctionSignature(openingLikeElement, elementType, /*candidatesOutArray*/ undefined);
+                    const callReturnType = callSignature && getReturnTypeOfSignature(callSignature);
+                    let paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0]));
+                    if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType)) {
+                        // Intersect in JSX.IntrinsicAttributes if it exists
+                        const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes);
+                        if (intrinsicAttributes !== unknownType) {
+                            paramType = intersectTypes(intrinsicAttributes, paramType);
+                        }
+                        return paramType;
+                    }
+                }
+            }
+            return undefined;
+        }
+
+        /**
+         * Get JSX attributes type by trying to resolve openingLikeElement as a stateless function component.
+         * Return all attributes type of resolved call signature including candidate signatures.
+         * This function assumes that the caller handled other possible element type of the JSX element.
+         * This function is a behavior used by language service when looking up completion in JSX element.,
+         * @param openingLikeElement a JSX opening-like element to find attributes type
+         * @param elementType a type of the opening-like element. This elementType can't be an union type
+         * @param elemInstanceType an element instance type (the result of newing or invoking this tag)
+         * @param elementClassType a JSX-ElementClass type. This is a result of looking up ElementClass interface in the JSX global
          */
-        function getResolvedJsxType(node: JsxOpeningLikeElement, elemType?: Type, elemClassType?: Type): Type {
-            if (!elemType) {
-                elemType = checkExpression(node.tagName);
-            }
-            if (elemType.flags & TypeFlags.Union) {
-                const types = (<UnionOrIntersectionType>elemType).types;
-                return getUnionType(map(types, type => {
-                    return getResolvedJsxType(node, type, elemClassType);
+        function tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement: JsxOpeningLikeElement, elementType: Type, elemInstanceType: Type, elementClassType?: Type): Type {
+            Debug.assert(!(elementType.flags & TypeFlags.Union));
+            if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) {
+                // Is this is a stateless function component? See if its single signature's return type is assignable to the JSX Element Type
+                if (jsxElementType) {
+                    // We don't call getResolvedSignature because here we have already resolve the type of JSX Element.
+                    const candidatesOutArray: Signature[] = [];
+                    getResolvedJSXStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray);
+                    let result: Type;
+                    let defaultResult: Type;
+                    for (const candidate of candidatesOutArray) {
+                        const callReturnType = getReturnTypeOfSignature(candidate);
+                        const paramType = callReturnType && (candidate.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(candidate.parameters[0]));
+                        if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType)) {
+                            let shouldBeCandidate = true;
+                            for (const attribute of openingLikeElement.attributes.properties) {
+                                if (isJsxAttribute(attribute) &&
+                                    isUnhyphenatedJsxName(attribute.name.text) &&
+                                    !getPropertyOfType(paramType, attribute.name.text)) {
+                                    shouldBeCandidate = false;
+                                    break;
+                                }
+                            }
+                            if (shouldBeCandidate) {
+                                result = intersectTypes(result, paramType);
+                            }
+                            defaultResult = intersectTypes(defaultResult, paramType);
+                        }
+                    }
+
+                    // If we can't find any matching, just return everything.
+                    if (!result) {
+                        result = defaultResult;
+                    }
+                    // Intersect in JSX.IntrinsicAttributes if it exists
+                    const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes);
+                    if (intrinsicAttributes !== unknownType) {
+                        result = intersectTypes(intrinsicAttributes, result);
+                    }
+                    return result;
+                }
+            }
+            return undefined;
+        }
+
+        /**
+         * Resolve attributes type of the given node. The function is intended to initially be called from getAttributesTypeFromJsxOpeningLikeElement which already handle JSX-intrinsic-element.
+         * @param openingLikeElement a non-intrinsic JSXOPeningLikeElement
+         * @param elementType an instance type of the given node
+         * @param elementClassType a JSX-ElementClass type. This is a result of looking up ElementClass interface in the JSX global (imported from react.d.ts)
+         * @return attributes'type if able to resolve the type of node
+         *         anyType if there is no type ElementAttributesProperty or there is an error
+         *         emptyObjectType if there is no "prop" in the element instance type
+         **/
+        function resolveCustomJsxElementAttributesType(openingLikeElement: JsxOpeningLikeElement,
+            shouldIncludeAllStatelessAttributesType: boolean,
+            elementType?: Type,
+            elementClassType?: Type): Type {
+            if (!elementType) {
+                elementType = checkExpression(openingLikeElement.tagName);
+            }
+
+            if (elementType.flags & TypeFlags.Union) {
+                const types = (elementType as UnionType).types;
+                return getUnionType(types.map(type => {
+                    return resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, type, elementClassType);
                 }), /*subtypeReduction*/ true);
             }
 
             // If the elemType is a string type, we have to return anyType to prevent an error downstream as we will try to find construct or call signature of the type
-            if (elemType.flags & TypeFlags.String) {
+            // If the elemType is a string type, we have to return anyType to prevent an error downstream as we will try to find construct or call signature of the type
+            if (elementType.flags & TypeFlags.String) {
                 return anyType;
             }
-            else if (elemType.flags & TypeFlags.StringLiteral) {
+            else if (elementType.flags & TypeFlags.StringLiteral) {
                 // If the elemType is a stringLiteral type, we can then provide a check to make sure that the string literal type is one of the Jsx intrinsic element type
+                // For example:
+                //      var CustomTag: "h1" = "h1";
+                //      <CustomTag> Hello World </CustomTag> 
                 const intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements);
                 if (intrinsicElementsType !== unknownType) {
-                    const stringLiteralTypeName = (<LiteralType>elemType).text;
+                    const stringLiteralTypeName = (<LiteralType>elementType).text;
                     const intrinsicProp = getPropertyOfType(intrinsicElementsType, stringLiteralTypeName);
                     if (intrinsicProp) {
                         return getTypeOfSymbol(intrinsicProp);
@@ -11273,37 +11510,27 @@ namespace ts {
                     if (indexSignatureType) {
                         return indexSignatureType;
                     }
-                    error(node, Diagnostics.Property_0_does_not_exist_on_type_1, stringLiteralTypeName, "JSX." + JsxNames.IntrinsicElements);
+                    error(openingLikeElement, Diagnostics.Property_0_does_not_exist_on_type_1, stringLiteralTypeName, "JSX." + JsxNames.IntrinsicElements);
                 }
                 // If we need to report an error, we already done so here. So just return any to prevent any more error downstream
                 return anyType;
             }
 
             // Get the element instance type (the result of newing or invoking this tag)
-            const elemInstanceType = getJsxElementInstanceType(node, elemType);
+            const elemInstanceType = getJsxElementInstanceType(openingLikeElement, elementType);
 
-            if (!elemClassType || !isTypeAssignableTo(elemInstanceType, elemClassType)) {
-                // Is this is a stateless function component? See if its single signature's return type is
-                // assignable to the JSX Element Type
-                if (jsxElementType) {
-                    const callSignatures = elemType && getSignaturesOfType(elemType, SignatureKind.Call);
-                    const callSignature = callSignatures && callSignatures.length > 0 && callSignatures[0];
-                    const callReturnType = callSignature && getReturnTypeOfSignature(callSignature);
-                    let paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0]));
-                    if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType)) {
-                        // Intersect in JSX.IntrinsicAttributes if it exists
-                        const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes);
-                        if (intrinsicAttributes !== unknownType) {
-                            paramType = intersectTypes(intrinsicAttributes, paramType);
-                        }
-                        return paramType;
-                    }
-                }
+            // Is this is a stateless function component? See if its single signature's return type is assignable to the JSX Element Type
+            const statelessAttributesType = shouldIncludeAllStatelessAttributesType ?
+                tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) :
+                defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType);
+
+            if (statelessAttributesType) {
+                return statelessAttributesType;
             }
 
             // Issue an error if this return type isn't assignable to JSX.ElementClass
-            if (elemClassType) {
-                checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements);
+            if (elementClassType) {
+                checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements);
             }
 
             if (isTypeAny(elemInstanceType)) {
@@ -11332,7 +11559,7 @@ namespace ts {
                 }
                 else if (attributesType.flags & TypeFlags.Union) {
                     // Props cannot be a union type
-                    error(node.tagName, Diagnostics.JSX_element_attributes_type_0_may_not_be_a_union_type, typeToString(attributesType));
+                    error(openingLikeElement.tagName, Diagnostics.JSX_element_attributes_type_0_may_not_be_a_union_type, typeToString(attributesType));
                     return anyType;
                 }
                 else {
@@ -11362,30 +11589,62 @@ namespace ts {
         }
 
         /**
-         * Given an opening/self-closing element, get the 'element attributes type', i.e. the type that tells
-         * us which attributes are valid on a given element.
+         * Get attributes type of the given intrinsic opening-like Jsx element by resolving the tag name.
+         * The function is intended to be called from a function which has checked that the opening element is an intrinsic element.
+         * @param node an intrinsic JSX oopening-like element
          */
-        function getJsxElementAttributesType(node: JsxOpeningLikeElement): Type {
+        function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node: JsxOpeningLikeElement): Type {
             const links = getNodeLinks(node);
-            if (!links.resolvedJsxType) {
-                if (isJsxIntrinsicIdentifier(node.tagName)) {
-                    const symbol = getIntrinsicTagSymbol(node);
-                    if (links.jsxFlags & JsxFlags.IntrinsicNamedElement) {
-                        return links.resolvedJsxType = getTypeOfSymbol(symbol);
-                    }
-                    else if (links.jsxFlags & JsxFlags.IntrinsicIndexedElement) {
-                        return links.resolvedJsxType = getIndexInfoOfSymbol(symbol, IndexKind.String).type;
-                    }
-                    else {
-                        return links.resolvedJsxType = unknownType;
-                    }
+            if (!links.resolvedJsxElementAttributesType) {
+                const symbol = getIntrinsicTagSymbol(node);
+                if (links.jsxFlags & JsxFlags.IntrinsicNamedElement) {
+                    return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol);
+                }
+                else if (links.jsxFlags & JsxFlags.IntrinsicIndexedElement) {
+                    return links.resolvedJsxElementAttributesType = getIndexInfoOfSymbol(symbol, IndexKind.String).type;
                 }
                 else {
-                    const elemClassType = getJsxGlobalElementClassType();
-                    return links.resolvedJsxType = getResolvedJsxType(node, undefined, elemClassType);
+                    return links.resolvedJsxElementAttributesType = unknownType;
                 }
             }
-            return links.resolvedJsxType;
+            return links.resolvedJsxElementAttributesType;
+        }
+
+        /**
+         * Get attributes type of the given custom opening-like Jsx element.
+         * The function is intended to be called from a function which has handle intrinsic Jsx element already.
+         * @param node a custom Jsx opening-like element
+         */
+        function getCustomJsxElementAttributesType(node: JsxOpeningLikeElement, shouldIncludeAllStatelessAttributesType = false): Type {
+            const links = getNodeLinks(node);
+            if (!links.resolvedJsxElementAttributesType) {
+                const elemClassType = getJsxGlobalElementClassType();
+                return links.resolvedJsxElementAttributesType = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, undefined, elemClassType);
+            }
+            return links.resolvedJsxElementAttributesType;
+        }
+
+        function getAllAttributesTypeFromJsxOpeningLikeElement(node: JsxOpeningLikeElement): Type {
+            if (isJsxIntrinsicIdentifier(node.tagName)) {
+                return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node);
+            }
+            else {
+                return getCustomJsxElementAttributesType(node, /*shouldIncludeAllStatelessAttributesType*/ true);
+            }
+        }
+
+        /**
+         * Get the attributes type which is the type that indicate which attributes are valid on the given JSXOpeningLikeElement.
+         * @param node a JSXOpeningLikeElement node
+         * @return an attributes type of the given node
+         */
+        function getAttributesTypeFromJsxOpeningLikeElement(node: JsxOpeningLikeElement): Type {
+            if (isJsxIntrinsicIdentifier(node.tagName)) {
+                return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node);
+            }
+            else {
+                return getCustomJsxElementAttributesType(node);
+            }
         }
 
         /**
@@ -11394,7 +11653,7 @@ namespace ts {
          * that have no matching element attributes type property.
          */
         function getJsxAttributePropertySymbol(attrib: JsxAttribute): Symbol {
-            const attributesType = getJsxElementAttributesType(<JsxOpeningElement>attrib.parent);
+            const attributesType = getAttributesTypeFromJsxOpeningLikeElement(attrib.parent.parent as JsxOpeningElement);
             const prop = getPropertyOfType(attributesType, attrib.name.text);
             return prop || unknownSymbol;
         }
@@ -11425,14 +11684,15 @@ namespace ts {
             }
         }
 
-        function checkJsxOpeningLikeElement(node: JsxOpeningLikeElement) {
-            checkGrammarJsxElement(node);
-            checkJsxPreconditions(node);
+        function checkJsxOpeningLikeElement(openingLikeElement: JsxOpeningLikeElement) {
+            checkGrammarJsxElement(openingLikeElement);
+            checkJsxPreconditions(openingLikeElement);
+
             // The reactNamespace symbol should be marked as 'used' so we don't incorrectly elide its import. And if there
             // is no reactNamespace symbol in scope when targeting React emit, we should issue an error.
             const reactRefErr = compilerOptions.jsx === JsxEmit.React ? Diagnostics.Cannot_find_name_0 : undefined;
             const reactNamespace = compilerOptions.reactNamespace ? compilerOptions.reactNamespace : "React";
-            const reactSym = resolveName(node.tagName, reactNamespace, SymbolFlags.Value, reactRefErr, reactNamespace);
+            const reactSym = resolveName(openingLikeElement.tagName, reactNamespace, SymbolFlags.Value, reactRefErr, reactNamespace);
             if (reactSym) {
                 // Mark local symbol as referenced here because it might not have been marked
                 // if jsx emit was not react as there wont be error being emitted
@@ -11444,38 +11704,7 @@ namespace ts {
                 }
             }
 
-            const targetAttributesType = getJsxElementAttributesType(node);
-
-            const nameTable = createMap<boolean>();
-            // Process this array in right-to-left order so we know which
-            // attributes (mostly from spreads) are being overwritten and
-            // thus should have their types ignored
-            let sawSpreadedAny = false;
-            for (let i = node.attributes.length - 1; i >= 0; i--) {
-                if (node.attributes[i].kind === SyntaxKind.JsxAttribute) {
-                    checkJsxAttribute(<JsxAttribute>(node.attributes[i]), targetAttributesType, nameTable);
-                }
-                else {
-                    Debug.assert(node.attributes[i].kind === SyntaxKind.JsxSpreadAttribute);
-                    const spreadType = checkJsxSpreadAttribute(<JsxSpreadAttribute>(node.attributes[i]), targetAttributesType, nameTable);
-                    if (isTypeAny(spreadType)) {
-                        sawSpreadedAny = true;
-                    }
-                }
-            }
-
-            // Check that all required properties have been provided. If an 'any'
-            // was spreaded in, though, assume that it provided all required properties
-            if (targetAttributesType && !sawSpreadedAny) {
-                const targetProperties = getPropertiesOfType(targetAttributesType);
-                for (let i = 0; i < targetProperties.length; i++) {
-                    if (!(targetProperties[i].flags & SymbolFlags.Optional) &&
-                        !nameTable[targetProperties[i].name]) {
-
-                        error(node, Diagnostics.Property_0_is_missing_in_type_1, targetProperties[i].name, typeToString(targetAttributesType));
-                    }
-                }
-            }
+            checkJSXAttributesAssignableToTagnameAttributes(openingLikeElement);
         }
 
         function checkJsxExpression(node: JsxExpression) {
@@ -11632,6 +11861,21 @@ namespace ts {
             diagnostics.add(createDiagnosticForNodeFromMessageChain(propNode, errorInfo));
         }
 
+        function markPropertyAsReferenced(prop: Symbol) {
+            if (prop &&
+                noUnusedIdentifiers &&
+                (prop.flags & SymbolFlags.ClassMember) &&
+                prop.valueDeclaration && (getModifierFlags(prop.valueDeclaration) & ModifierFlags.Private)) {
+                if (prop.flags & SymbolFlags.Instantiated) {
+                    getSymbolLinks(prop).target.isReferenced = true;
+
+                }
+                else {
+                    prop.isReferenced = true;
+                }
+            }
+        }
+
         function checkPropertyAccessExpressionOrQualifiedName(node: PropertyAccessExpression | QualifiedName, left: Expression | QualifiedName, right: Identifier) {
             const type = checkNonNullExpression(left);
             if (isTypeAny(type) || type === silentNeverType) {
@@ -11651,17 +11895,7 @@ namespace ts {
                 return unknownType;
             }
 
-            if (noUnusedIdentifiers &&
-                (prop.flags & SymbolFlags.ClassMember) &&
-                prop.valueDeclaration && (getModifierFlags(prop.valueDeclaration) & ModifierFlags.Private)) {
-                if (prop.flags & SymbolFlags.Instantiated) {
-                    getSymbolLinks(prop).target.isReferenced = true;
-
-                }
-                else {
-                    prop.isReferenced = true;
-                }
-            }
+            markPropertyAsReferenced(prop);
 
             getNodeLinks(node).resolvedSymbol = prop;
 
@@ -11919,6 +12153,13 @@ namespace ts {
             let isDecorator: boolean;
             let spreadArgIndex = -1;
 
+            if (isJsxOpeningLikeElement(node)) {
+                // For JSX opening-like element, we will ignore regular arity check (which is what is done here).
+                // Instead, the arity check will be done in "checkApplicableSignatureForJsxOpeningLikeElement" as we are required to figure out
+                // all property inside give attributes.
+                return true;
+            }
+
             if (node.kind === SyntaxKind.TaggedTemplateExpression) {
                 const tagExpression = <TaggedTemplateExpression>node;
 
@@ -11960,7 +12201,7 @@ namespace ts {
 
                 argCount = signatureHelpTrailingComma ? args.length + 1 : args.length;
 
-                // If we are missing the close paren, the call is incomplete.
+                // If we are missing the close parenthesis, the call is incomplete.
                 callIsIncomplete = callExpression.arguments.end === callExpression.end;
 
                 typeArguments = callExpression.typeArguments;
@@ -12118,6 +12359,51 @@ namespace ts {
             return typeArgumentsAreAssignable;
         }
 
+        /**
+         * Check if the given signature can possibly be a signature called by the JSX opening-like element.
+         * @param node a JSX opening-like element we are trying to figure its call signature
+         * @param signature a candidate signature we are trying whether it is a call signature
+         * @param relation a relationship to check parameter and argument type
+         * @param excludeArgument
+         */
+        function checkApplicableSignatureForJsxOpeningLikeElement(node: JsxOpeningLikeElement, signature: Signature, relation: Map<RelationComparisonResult>) {
+            const headMessage = Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1;
+            // Stateless function components can have maximum of three arguments: "props", "context", and "updater".
+            // However "context" and "updater" are implicit and can't be specify by users. Only the first parameter, props,
+            // can be specified by users through attributes property.
+            const paramType = getTypeAtPosition(signature, 0);
+
+            // JSX opening-like element has correct arity for stateless-function component if the one of the following condition is true:
+            //      1. callIsInCompletes
+            //      2. attributes property has same number of properties as the parameter object type.
+            //         We can figure that out by resolving attributes property and check number of properties in the resolved type
+            // If the call has correct arity, we will then check if the argument type and parameter type is assignable
+
+            const callIsIncomplete = node.attributes.end === node.end;  // If we are missing the close "/>", the call is incomplete
+            const argType = checkExpressionWithContextualType(node.attributes, paramType, /*contextualMapper*/ undefined);
+            const argProperties = getPropertiesOfType(argType);
+            const paramProperties = getPropertiesOfType(paramType);
+            if (callIsIncomplete) {
+                return true;
+            }
+            else if (argProperties.length === paramProperties.length && checkTypeRelatedTo(argType, paramType, relation, /*errorNode*/ undefined, headMessage)) {
+                return true;
+            }
+            else {
+                let shouldCheckArgumentAndParameter = true;
+                for (const arg of argProperties) {
+                    if (!getPropertyOfType(paramType, arg.name) && isUnhyphenatedJsxName(arg.name)) {
+                        shouldCheckArgumentAndParameter = false;
+                        break;
+                    }
+                }
+                if (shouldCheckArgumentAndParameter && checkTypeRelatedTo(argType, paramType, relation, /*errorNode*/ undefined, headMessage)) {
+                    return true;
+                }
+            }
+            return false;
+        }
+
         function checkApplicableSignature(node: CallLikeExpression, args: Expression[], signature: Signature, relation: Map<RelationComparisonResult>, excludeArgument: boolean[], reportErrors: boolean) {
             const thisType = getThisTypeOfSignature(signature);
             if (thisType && thisType !== voidType && node.kind !== SyntaxKind.NewExpression) {
@@ -12200,8 +12486,13 @@ namespace ts {
                 // `getEffectiveArgumentCount` and `getEffectiveArgumentType` below.
                 return undefined;
             }
+            else if (isJsxOpeningLikeElement(node)) {
+                // For a JSX opening-like element, even though we will recheck the attributes again in "checkApplicableSignatureForJsxOpeningLikeElement" to figure out correct arity.
+                // We still return it here because when using infer type-argument we still have to getEffectiveArgument in trying to infer type-argument.
+                args = node.attributes.properties.length > 0 ? [node.attributes] : [];
+            }
             else {
-                args = (<CallExpression>node).arguments || emptyArray;
+                args = node.arguments || emptyArray;
             }
 
             return args;
@@ -12443,7 +12734,6 @@ namespace ts {
             else if (argIndex === 0 && node.kind === SyntaxKind.TaggedTemplateExpression) {
                 return getGlobalTemplateStringsArrayType();
             }
-
             // This is not a synthetic argument, so we return 'undefined'
             // to signal that the caller needs to check the argument.
             return undefined;
@@ -12482,10 +12772,11 @@ namespace ts {
         function resolveCall(node: CallLikeExpression, signatures: Signature[], candidatesOutArray: Signature[], headMessage?: DiagnosticMessage): Signature {
             const isTaggedTemplate = node.kind === SyntaxKind.TaggedTemplateExpression;
             const isDecorator = node.kind === SyntaxKind.Decorator;
+            const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
 
             let typeArguments: TypeNode[];
 
-            if (!isTaggedTemplate && !isDecorator) {
+            if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) {
                 typeArguments = (<CallExpression>node).typeArguments;
 
                 // We already perform checking on the type arguments on the class declaration itself.
@@ -12519,7 +12810,7 @@ namespace ts {
             // For a decorator, no arguments are susceptible to contextual typing due to the fact
             // decorators are applied to a declaration by the emitter, and not to an expression.
             let excludeArgument: boolean[];
-            if (!isDecorator) {
+            if (!isDecorator && !isJsxOpeningOrSelfClosingElement) {
                 // We do not need to call `getEffectiveArgumentCount` here as it only
                 // applies when calculating the number of arguments for a decorator.
                 for (let i = isTaggedTemplate ? 1 : 0; i < args.length; i++) {
@@ -12583,10 +12874,19 @@ namespace ts {
                 resultOfFailedInference = undefined;
                 result = chooseOverload(candidates, assignableRelation, signatureHelpTrailingComma);
             }
+
             if (result) {
                 return result;
             }
 
+            // Do not report any error if we are doing so for stateless function component as such error will be error will be handle in "resolveCustomJsxElementAttributesType".
+            if (isJsxOpeningOrSelfClosingElement) {
+                // If this is a type resolution session, e.g. Language Service, just return undefined as the language service can decide how to proceed with this failure.
+                // (see getDefinitionAtPosition which simply get the symbol and return the first declaration of the JSXopeningLikeElement node)
+                // otherwise, just return the latest signature candidate we try so far so that when we report an error we will get better error message.
+                return produceDiagnostics ? candidateForArgumentError : undefined;
+            }
+
             // No signatures were applicable. Now report errors based on the last applicable signature with
             // no arguments excluded from assignability checks.
             // If candidate is undefined, it means that no candidates had a suitable arity. In that case,
@@ -12643,6 +12943,9 @@ namespace ts {
             return resolveErrorCall(node);
 
             function reportError(message: DiagnosticMessage, arg0?: string, arg1?: string, arg2?: string): void {
+                if (isJsxOpeningOrSelfClosingElement) {
+                    return;
+                }
                 let errorInfo: DiagnosticMessageChain;
                 errorInfo = chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2);
                 if (headMessage) {
@@ -12682,7 +12985,10 @@ namespace ts {
                             }
                             candidate = getSignatureInstantiation(candidate, typeArgumentTypes);
                         }
-                        if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, /*reportErrors*/ false)) {
+                        if (isJsxOpeningOrSelfClosingElement && !checkApplicableSignatureForJsxOpeningLikeElement(<JsxOpeningLikeElement>node, candidate, relation)) {
+                            break;
+                        }
+                        else if (!isJsxOpeningOrSelfClosingElement && !checkApplicableSignature(node, args, candidate, relation, excludeArgument, /*reportErrors*/ false)) {
                             break;
                         }
                         const index = excludeArgument ? indexOf(excludeArgument, true) : -1;
@@ -12994,6 +13300,69 @@ namespace ts {
             return resolveCall(node, callSignatures, candidatesOutArray, headMessage);
         }
 
+        /**
+         * 
+         * @param openingLikeElement
+         * @param elementType
+         * @param candidatesOutArray
+         */
+        function getResolvedJSXStatelessFunctionSignature(openingLikeElement: JsxOpeningLikeElement, elementType: Type, candidatesOutArray: Signature[]): Signature {
+            Debug.assert(!(elementType.flags & TypeFlags.Union));
+            const links = getNodeLinks(openingLikeElement);
+            // If getResolvedSignature has already been called, we will have cached the resolvedSignature.
+            // However, it is possible that either candidatesOutArray was not passed in the first time,
+            // or that a different candidatesOutArray was passed in. Therefore, we need to redo the work
+            // to correctly fill the candidatesOutArray.
+            const cached = links.resolvedSignature;
+            if (cached && cached !== resolvingSignature && !candidatesOutArray) {
+                return cached;
+            }
+            links.resolvedSignature = resolvingSignature;
+
+            let callSignature = resolvedStateLessJsxOpeningLikeElement(openingLikeElement, elementType, candidatesOutArray);
+            if (!callSignature || callSignature === unknownSignature) {
+                const callSignatures = elementType && getSignaturesOfType(elementType, SignatureKind.Call);
+                callSignature = callSignatures[callSignatures.length - 1];
+            }
+            links.resolvedSignature = callSignature;
+            // If signature resolution originated in control flow type analysis (for example to compute the
+            // assigned type in a flow assignment) we don't cache the result as it may be based on temporary
+            // types from the control flow analysis.
+            links.resolvedSignature = flowLoopStart === flowLoopCount ? callSignature : cached;
+            return callSignature;
+        }
+
+        /**
+         * Try treating a given opening-like element as stateless function component and try to resolve a signature.
+         * @param openingLikeElement an JsxOpeningLikeElement we want to try resolve its state-less function if possible
+         * @param elementType a type of the opening-like JSX element, a result of resolving tagName in opening-like element.
+         * @param candidatesOutArray an array of signature to be filled in by the function. It is passed by signature help in the language service;
+         *                           the function will fill it up with appropriate candidate signatures
+         * @return a resolved signature if we can find function matching function signature through resolve call or a first signature in the list of functions.
+         *         otherwise return undefined if tag-name of the opening-like element doesn't have call signatures
+         */
+        function resolvedStateLessJsxOpeningLikeElement(openingLikeElement: JsxOpeningLikeElement, elementType: Type, candidatesOutArray: Signature[]): Signature {
+            if (elementType.flags & TypeFlags.Union) {
+                const types = (elementType as UnionType).types;
+                let result: Signature;
+                types.map(type => {
+                    // This is mainly to fill in all the candidates if there is one.
+                    result = result || resolvedStateLessJsxOpeningLikeElement(openingLikeElement, type, candidatesOutArray);
+                });
+
+                return result;
+            }
+
+            const callSignatures = elementType && getSignaturesOfType(elementType, SignatureKind.Call);
+            if (callSignatures && callSignatures.length > 0) {
+                let callSignature: Signature;
+                callSignature = resolveCall(openingLikeElement, callSignatures, candidatesOutArray);
+                return callSignature;
+            }
+
+            return undefined;
+        }
+
         function resolveSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature {
             switch (node.kind) {
                 case SyntaxKind.CallExpression:
@@ -13004,12 +13373,20 @@ namespace ts {
                     return resolveTaggedTemplateExpression(<TaggedTemplateExpression>node, candidatesOutArray);
                 case SyntaxKind.Decorator:
                     return resolveDecorator(<Decorator>node, candidatesOutArray);
+                case SyntaxKind.JsxOpeningElement:
+                case SyntaxKind.JsxSelfClosingElement:
+                    return resolvedStateLessJsxOpeningLikeElement(<JsxOpeningLikeElement>node, checkExpression((<JsxOpeningLikeElement>node).tagName), candidatesOutArray);
             }
             Debug.fail("Branch in 'resolveSignature' should be unreachable.");
         }
 
-        // candidatesOutArray is passed by signature help in the language service, and collectCandidates
-        // must fill it up with the appropriate candidate signatures
+        /**
+         * Resolve a signature of a given call-like expression.
+         * @param node a call-like expression to try resolve a signature for
+         * @param candidatesOutArray an array of signature to be filled in by the function. It is passed by signature help in the language service;
+         *                           the function will fill it up with appropriate candidate signatures
+         * @return a signature of the call-like expression or undefined if one can't be found
+         */
         function getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature {
             const links = getNodeLinks(node);
             // If getResolvedSignature has already been called, we will have cached the resolvedSignature.
@@ -14565,6 +14942,8 @@ namespace ts {
                     return checkJsxElement(<JsxElement>node);
                 case SyntaxKind.JsxSelfClosingElement:
                     return checkJsxSelfClosingElement(<JsxSelfClosingElement>node);
+                case SyntaxKind.JsxAttributes:
+                    return checkJsxAttributes(<JsxAttributes>node);
                 case SyntaxKind.JsxOpeningElement:
                     Debug.fail("Shouldn't ever directly check a JsxOpeningElement");
             }
@@ -16453,6 +16832,7 @@ namespace ts {
                 const parentType = getTypeForBindingElementParent(parent);
                 const name = node.propertyName || <Identifier>node.name;
                 const property = getPropertyOfType(parentType, getTextOfPropertyName(name));
+                markPropertyAsReferenced(property);
                 if (parent.initializer && property && getParentOfSymbol(property)) {
                     checkClassPropertyAccess(parent, parent.initializer, parentType, property);
                 }
@@ -20595,7 +20975,8 @@ namespace ts {
 
         function checkGrammarJsxElement(node: JsxOpeningLikeElement) {
             const seen = createMap<boolean>();
-            for (const attr of node.attributes) {
+
+            for (const attr of node.attributes.properties) {
                 if (attr.kind === SyntaxKind.JsxSpreadAttribute) {
                     continue;
                 }
diff --git a/src/compiler/core.ts b/src/compiler/core.ts
index dd71877930a62..8175730159b0b 100644
--- a/src/compiler/core.ts
+++ b/src/compiler/core.ts
@@ -1127,6 +1127,18 @@ namespace ts {
         };
     }
 
+    export function createCompilerDiagnosticFromMessageChain(chain: DiagnosticMessageChain): Diagnostic {
+        return {
+            file: undefined,
+            start: undefined,
+            length: undefined,
+
+            code: chain.code,
+            category: chain.category,
+            messageText: chain.next ? chain : chain.messageText
+        };
+    }
+
     export function chainDiagnosticMessages(details: DiagnosticMessageChain, message: DiagnosticMessage, ...args: any[]): DiagnosticMessageChain;
     export function chainDiagnosticMessages(details: DiagnosticMessageChain, message: DiagnosticMessage): DiagnosticMessageChain {
         let text = getLocaleSpecificMessage(message);
diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json
index 58c59b18f5e45..99b24fdda2b45 100644
--- a/src/compiler/diagnosticMessages.json
+++ b/src/compiler/diagnosticMessages.json
@@ -2893,6 +2893,14 @@
         "category": "Error",
         "code": 6143
     },
+    "Module '{0}' was resolved as locally declared ambient module in file '{1}'.": {
+        "category": "Message",
+        "code": 6144
+    },
+    "Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified.": {
+        "category": "Message",
+        "code": 6145
+    },
     "Variable '{0}' implicitly has an '{1}' type.": {
         "category": "Error",
         "code": 7005
@@ -3154,5 +3162,9 @@
     "Implement inherited abstract class": {
         "category": "Message",
         "code": 90007
+    },
+    "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig": {
+        "category": "Error",
+        "code": 90009
     }
 }
diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts
index b0413b2578e8f..0ad1a3ce0be78 100644
--- a/src/compiler/emitter.ts
+++ b/src/compiler/emitter.ts
@@ -712,6 +712,8 @@ const _super = (function (geti, seti) {
                     return emitJsxClosingElement(<JsxClosingElement>node);
                 case SyntaxKind.JsxAttribute:
                     return emitJsxAttribute(<JsxAttribute>node);
+                case SyntaxKind.JsxAttributes:
+                    return emitJsxAttributes(<JsxAttributes>node);
                 case SyntaxKind.JsxSpreadAttribute:
                     return emitJsxSpreadAttribute(<JsxSpreadAttribute>node);
                 case SyntaxKind.JsxExpression:
@@ -1969,15 +1971,21 @@ const _super = (function (geti, seti) {
             write("<");
             emitJsxTagName(node.tagName);
             write(" ");
-            emitList(node, node.attributes, ListFormat.JsxElementAttributes);
+            // We are checking here so we won't re-enter the emiting pipeline and emit extra sourcemap
+            if (node.attributes.properties && node.attributes.properties.length > 0) {
+                emit(node.attributes);
+            }
             write("/>");
         }
 
         function emitJsxOpeningElement(node: JsxOpeningElement) {
             write("<");
             emitJsxTagName(node.tagName);
-            writeIfAny(node.attributes, " ");
-            emitList(node, node.attributes, ListFormat.JsxElementAttributes);
+            writeIfAny(node.attributes.properties, " ");
+            // We are checking here so we won't re-enter the emiting pipeline and emit extra sourcemap
+            if (node.attributes.properties && node.attributes.properties.length > 0) {
+                emit(node.attributes);
+            }
             write(">");
         }
 
@@ -1991,6 +1999,10 @@ const _super = (function (geti, seti) {
             write(">");
         }
 
+        function emitJsxAttributes(node: JsxAttributes) {
+            emitList(node, node.properties, ListFormat.JsxElementAttributes);
+        }
+
         function emitJsxAttribute(node: JsxAttribute) {
             emit(node.name);
             emitWithPrefix("=", node.initializer);
diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts
index fd2b7c1ccee34..6f8ecaa03ff65 100644
--- a/src/compiler/factory.ts
+++ b/src/compiler/factory.ts
@@ -1237,28 +1237,28 @@ namespace ts {
         return node;
     }
 
-    export function createJsxSelfClosingElement(tagName: JsxTagNameExpression, attributes: JsxAttributeLike[], location?: TextRange) {
+    export function createJsxSelfClosingElement(tagName: JsxTagNameExpression, attributes: JsxAttributes, location?: TextRange) {
         const node = <JsxSelfClosingElement>createNode(SyntaxKind.JsxSelfClosingElement, location);
         node.tagName = tagName;
-        node.attributes = createNodeArray(attributes);
+        node.attributes = attributes;
         return node;
     }
 
-    export function updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: JsxTagNameExpression, attributes: JsxAttributeLike[]) {
+    export function updateJsxSelfClosingElement(node: JsxSelfClosingElement, tagName: JsxTagNameExpression, attributes: JsxAttributes) {
         if (node.tagName !== tagName || node.attributes !== attributes) {
             return updateNode(createJsxSelfClosingElement(tagName, attributes, node), node);
         }
         return node;
     }
 
-    export function createJsxOpeningElement(tagName: JsxTagNameExpression, attributes: JsxAttributeLike[], location?: TextRange) {
+    export function createJsxOpeningElement(tagName: JsxTagNameExpression, attributes: JsxAttributes, location?: TextRange) {
         const node = <JsxOpeningElement>createNode(SyntaxKind.JsxOpeningElement, location);
         node.tagName = tagName;
-        node.attributes = createNodeArray(attributes);
+        node.attributes = attributes;
         return node;
     }
 
-    export function updateJsxOpeningElement(node: JsxOpeningElement, tagName: JsxTagNameExpression, attributes: JsxAttributeLike[]) {
+    export function updateJsxOpeningElement(node: JsxOpeningElement, tagName: JsxTagNameExpression, attributes: JsxAttributes) {
         if (node.tagName !== tagName || node.attributes !== attributes) {
             return updateNode(createJsxOpeningElement(tagName, attributes, node), node);
         }
@@ -1278,6 +1278,20 @@ namespace ts {
         return node;
     }
 
+    export function createJsxAttributes(properties: JsxAttributeLike[], location?: TextRange) {
+        const jsxAttributes = <JsxAttributes>createNode(SyntaxKind.JsxAttributes, location);
+        setEmitFlags(jsxAttributes, EmitFlags.NoSourceMap);
+        jsxAttributes.properties = createNodeArray(properties);
+        return jsxAttributes;
+    }
+
+    export function updateJsxAttributes(jsxAttributes: JsxAttributes, properties: JsxAttributeLike[]) {
+        if (jsxAttributes.properties !== properties) {
+            return updateNode(createJsxAttributes(properties, jsxAttributes), jsxAttributes);
+        }
+        return jsxAttributes;
+    }
+
     export function createJsxAttribute(name: Identifier, initializer: StringLiteral | JsxExpression, location?: TextRange) {
         const node = <JsxAttribute>createNode(SyntaxKind.JsxAttribute, location);
         node.name = name;
diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts
index 9e159a356c7c7..86e0157d84729 100644
--- a/src/compiler/moduleNameResolver.ts
+++ b/src/compiler/moduleNameResolver.ts
@@ -2,12 +2,15 @@
 /// <reference path="diagnosticInformationMap.generated.ts" />
 
 namespace ts {
-    function trace(host: ModuleResolutionHost, message: DiagnosticMessage, ...args: any[]): void;
-    function trace(host: ModuleResolutionHost): void {
+
+    /* @internal */
+    export function trace(host: ModuleResolutionHost, message: DiagnosticMessage, ...args: any[]): void;
+    export function trace(host: ModuleResolutionHost): void {
         host.trace(formatMessage.apply(undefined, arguments));
     }
 
-    function isTraceEnabled(compilerOptions: CompilerOptions, host: ModuleResolutionHost): boolean {
+    /* @internal */
+    export function isTraceEnabled(compilerOptions: CompilerOptions, host: ModuleResolutionHost): boolean {
         return compilerOptions.traceResolution && host.trace !== undefined;
     }
 
diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts
index 9e0a5b4cd3379..83773f8fe263b 100644
--- a/src/compiler/parser.ts
+++ b/src/compiler/parser.ts
@@ -361,7 +361,9 @@ namespace ts {
             case SyntaxKind.JsxSelfClosingElement:
             case SyntaxKind.JsxOpeningElement:
                 return visitNode(cbNode, (<JsxOpeningLikeElement>node).tagName) ||
-                    visitNodes(cbNodes, (<JsxOpeningLikeElement>node).attributes);
+                    visitNode(cbNode, (<JsxOpeningLikeElement>node).attributes);
+            case SyntaxKind.JsxAttributes:
+                return visitNodes(cbNodes, (<JsxAttributes>node).properties);
             case SyntaxKind.JsxAttribute:
                 return visitNode(cbNode, (<JsxAttribute>node).name) ||
                     visitNode(cbNode, (<JsxAttribute>node).initializer);
@@ -3795,14 +3797,20 @@ namespace ts {
             return result;
         }
 
+        function parseJsxAttributes(): JsxAttributes {
+            const jsxAttributes = <JsxAttributes>createNode(SyntaxKind.JsxAttributes);
+            jsxAttributes.properties = parseList(ParsingContext.JsxAttributes, parseJsxAttribute);
+            return finishNode(jsxAttributes);
+        }
+
         function parseJsxOpeningOrSelfClosingElement(inExpressionContext: boolean): JsxOpeningElement | JsxSelfClosingElement {
             const fullStart = scanner.getStartPos();
 
             parseExpected(SyntaxKind.LessThanToken);
 
             const tagName = parseJsxElementName();
+            const attributes = parseJsxAttributes();
 
-            const attributes = parseList(ParsingContext.JsxAttributes, parseJsxAttribute);
             let node: JsxOpeningLikeElement;
 
             if (token() === SyntaxKind.GreaterThanToken) {
diff --git a/src/compiler/program.ts b/src/compiler/program.ts
index 726df380e81b1..dcb9cce0adb55 100644
--- a/src/compiler/program.ts
+++ b/src/compiler/program.ts
@@ -239,11 +239,11 @@ namespace ts {
                 const { line, character } = getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
                 const fileName = diagnostic.file.fileName;
                 const relativeFileName = convertToRelativePath(fileName, host.getCurrentDirectory(), fileName => host.getCanonicalFileName(fileName));
-                output += `${ relativeFileName }(${ line + 1 },${ character + 1 }): `;
+                output += `${relativeFileName}(${line + 1},${character + 1}): `;
             }
 
             const category = DiagnosticCategory[diagnostic.category].toLowerCase();
-            output += `${ category } TS${ diagnostic.code }: ${ flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) }${ host.getNewLine() }`;
+            output += `${category} TS${diagnostic.code}: ${flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())}${host.getNewLine()}`;
         }
         return output;
     }
@@ -462,6 +462,130 @@ namespace ts {
             return classifiableNames;
         }
 
+        interface OldProgramState {
+            program: Program;
+            file: SourceFile;
+            modifiedFilePaths: Path[];
+        }
+
+        function resolveModuleNamesReusingOldState(moduleNames: string[], containingFile: string, file: SourceFile, oldProgramState?: OldProgramState) {
+            if (!oldProgramState && !file.ambientModuleNames.length) {
+                // if old program state is not supplied and file does not contain locally defined ambient modules
+                // then the best we can do is fallback to the default logic
+                return resolveModuleNamesWorker(moduleNames, containingFile);
+            }
+
+            // at this point we know that either 
+            // - file has local declarations for ambient modules
+            // OR
+            // - old program state is available
+            // OR
+            // - both of items above
+            // With this it is possible that we can tell how some module names from the initial list will be resolved
+            // without doing actual resolution (in particular if some name was resolved to ambient module).
+            // Such names should be excluded from the list of module names that will be provided to `resolveModuleNamesWorker`
+            // since we don't want to resolve them again.
+
+            // this is a list of modules for which we cannot predict resolution so they should be actually resolved
+            let unknownModuleNames: string[];
+            // this is a list of combined results assembles from predicted and resolved results.
+            // Order in this list matches the order in the original list of module names `moduleNames` which is important
+            // so later we can split results to resolutions of modules and resolutions of module augmentations.
+            let result: ResolvedModuleFull[];
+            // a transient placeholder that is used to mark predicted resolution in the result list
+            const predictedToResolveToAmbientModuleMarker: ResolvedModuleFull = <any>{};
+
+            for (let i = 0; i < moduleNames.length; i++) {
+                const moduleName = moduleNames[i];
+                // module name is known to be resolved to ambient module if
+                // - module name is contained in the list of ambient modules that are locally declared in the file
+                // - in the old program module name was resolved to ambient module whose declaration is in non-modified file
+                //   (so the same module declaration will land in the new program)
+                let isKnownToResolveToAmbientModule = false;
+                if (contains(file.ambientModuleNames, moduleName)) {
+                    isKnownToResolveToAmbientModule = true;
+                    if (isTraceEnabled(options, host)) {
+                        trace(host, Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName, containingFile);
+                    }
+                }
+                else {
+                    isKnownToResolveToAmbientModule = checkModuleNameResolvedToAmbientModuleInNonModifiedFile(moduleName, oldProgramState);
+                }
+
+                if (isKnownToResolveToAmbientModule) {
+                    if (!unknownModuleNames) {
+                        // found a first module name for which result can be prediced
+                        // this means that this module name should not be passed to `resolveModuleNamesWorker`.
+                        // We'll use a separate list for module names that are definitely unknown.
+                        result = new Array(moduleNames.length);
+                        // copy all module names that appear before the current one in the list
+                        // since they are known to be unknown
+                        unknownModuleNames = moduleNames.slice(0, i);
+                    }
+                    // mark prediced resolution in the result list
+                    result[i] = predictedToResolveToAmbientModuleMarker;
+                }
+                else if (unknownModuleNames) {
+                    // found unknown module name and we are already using separate list for those - add it to the list
+                    unknownModuleNames.push(moduleName);
+                }
+            }
+
+            if (!unknownModuleNames) {
+                // we've looked throught the list but have not seen any predicted resolution
+                // use default logic
+                return resolveModuleNamesWorker(moduleNames, containingFile);
+            }
+
+            const resolutions = unknownModuleNames.length
+                ? resolveModuleNamesWorker(unknownModuleNames, containingFile)
+                : emptyArray;
+
+            // combine results of resolutions and predicted results
+            let j = 0;
+            for (let i = 0; i < result.length; i++) {
+                if (result[i] == predictedToResolveToAmbientModuleMarker) {
+                    result[i] = undefined;
+                }
+                else {
+                    result[i] = resolutions[j];
+                    j++;
+                }
+            }
+            Debug.assert(j === resolutions.length);
+            return result;
+
+            function checkModuleNameResolvedToAmbientModuleInNonModifiedFile(moduleName: string, oldProgramState?: OldProgramState): boolean {
+                if (!oldProgramState) {
+                    return false;
+                }
+                const resolutionToFile = getResolvedModule(oldProgramState.file, moduleName);
+                if (resolutionToFile) {
+                    // module used to be resolved to file - ignore it
+                    return false;
+                }
+                const ambientModule = oldProgram.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(moduleName);
+                if (!(ambientModule && ambientModule.declarations)) {
+                    return false;
+                }
+
+                // at least one of declarations should come from non-modified source file
+                const firstUnmodifiedFile = forEach(ambientModule.declarations, d => {
+                    const f = getSourceFileOfNode(d);
+                    return !contains(oldProgramState.modifiedFilePaths, f.path) && f;
+                });
+
+                if (!firstUnmodifiedFile) {
+                    return false;
+                }
+
+                if (isTraceEnabled(options, host)) {
+                    trace(host, Diagnostics.Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified, moduleName, firstUnmodifiedFile.fileName);
+                }
+                return true;
+            }
+        }
+
         function tryReuseStructureFromOldProgram(): boolean {
             if (!oldProgram) {
                 return false;
@@ -489,7 +613,7 @@ namespace ts {
             // check if program source files has changed in the way that can affect structure of the program
             const newSourceFiles: SourceFile[] = [];
             const filePaths: Path[] = [];
-            const modifiedSourceFiles: SourceFile[] = [];
+            const modifiedSourceFiles: { oldFile: SourceFile, newFile: SourceFile }[] = [];
 
             for (const oldSourceFile of oldProgram.getSourceFiles()) {
                 let newSourceFile = host.getSourceFileByPath
@@ -532,29 +656,8 @@ namespace ts {
                         return false;
                     }
 
-                    const newSourceFilePath = getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory);
-                    if (resolveModuleNamesWorker) {
-                        const moduleNames = map(concatenate(newSourceFile.imports, newSourceFile.moduleAugmentations), getTextOfLiteral);
-                        const resolutions = resolveModuleNamesWorker(moduleNames, newSourceFilePath);
-                        // ensure that module resolution results are still correct
-                        const resolutionsChanged = hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, moduleResolutionIsEqualTo);
-                        if (resolutionsChanged) {
-                            return false;
-                        }
-                    }
-                    if (resolveTypeReferenceDirectiveNamesWorker) {
-                        const typesReferenceDirectives = map(newSourceFile.typeReferenceDirectives, x => x.fileName);
-                        const resolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFilePath);
-                        // ensure that types resolutions are still correct
-                        const resolutionsChanged = hasChangesInResolutions(typesReferenceDirectives, resolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, typeDirectiveIsEqualTo);
-                        if (resolutionsChanged) {
-                            return false;
-                        }
-                    }
-                    // pass the cache of module/types resolutions from the old source file
-                    newSourceFile.resolvedModules = oldSourceFile.resolvedModules;
-                    newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames;
-                    modifiedSourceFiles.push(newSourceFile);
+                    // tentatively approve the file
+                    modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile });
                 }
                 else {
                     // file has no changes - use it as is
@@ -565,6 +668,33 @@ namespace ts {
                 newSourceFiles.push(newSourceFile);
             }
 
+            const modifiedFilePaths = modifiedSourceFiles.map(f => f.newFile.path);
+            // try to verify results of module resolution 
+            for (const { oldFile: oldSourceFile, newFile: newSourceFile } of modifiedSourceFiles) {
+                const newSourceFilePath = getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory);
+                if (resolveModuleNamesWorker) {
+                    const moduleNames = map(concatenate(newSourceFile.imports, newSourceFile.moduleAugmentations), getTextOfLiteral);
+                    const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFilePath, newSourceFile, { file: oldSourceFile, program: oldProgram, modifiedFilePaths });
+                    // ensure that module resolution results are still correct
+                    const resolutionsChanged = hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, moduleResolutionIsEqualTo);
+                    if (resolutionsChanged) {
+                        return false;
+                    }
+                }
+                if (resolveTypeReferenceDirectiveNamesWorker) {
+                    const typesReferenceDirectives = map(newSourceFile.typeReferenceDirectives, x => x.fileName);
+                    const resolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFilePath);
+                    // ensure that types resolutions are still correct
+                    const resolutionsChanged = hasChangesInResolutions(typesReferenceDirectives, resolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, typeDirectiveIsEqualTo);
+                    if (resolutionsChanged) {
+                        return false;
+                    }
+                }
+                // pass the cache of module/types resolutions from the old source file
+                newSourceFile.resolvedModules = oldSourceFile.resolvedModules;
+                newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames;
+            }
+
             // update fileName -> file mapping
             for (let i = 0, len = newSourceFiles.length; i < len; i++) {
                 filesByName.set(filePaths[i], newSourceFiles[i]);
@@ -574,7 +704,7 @@ namespace ts {
             fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics();
 
             for (const modifiedFile of modifiedSourceFiles) {
-                fileProcessingDiagnostics.reattachFileDiagnostics(modifiedFile);
+                fileProcessingDiagnostics.reattachFileDiagnostics(modifiedFile.newFile);
             }
             resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives();
             oldProgram.structureIsReused = true;
@@ -994,9 +1124,11 @@ namespace ts {
 
             const isJavaScriptFile = isSourceFileJavaScript(file);
             const isExternalModuleFile = isExternalModule(file);
+            const isDtsFile = isDeclarationFile(file);
 
             let imports: LiteralExpression[];
             let moduleAugmentations: LiteralExpression[];
+            let ambientModules: string[];
 
             // If we are importing helpers, we need to add a synthetic reference to resolve the
             // helpers library.
@@ -1018,6 +1150,7 @@ namespace ts {
 
             file.imports = imports || emptyArray;
             file.moduleAugmentations = moduleAugmentations || emptyArray;
+            file.ambientModuleNames = ambientModules || emptyArray;
 
             return;
 
@@ -1053,6 +1186,10 @@ namespace ts {
                                 (moduleAugmentations || (moduleAugmentations = [])).push(moduleName);
                             }
                             else if (!inAmbientModule) {
+                                if (isDtsFile) {
+                                    // for global .d.ts files record name of ambient module
+                                    (ambientModules || (ambientModules = [])).push(moduleName.text);
+                                }
                                 // An AmbientExternalModuleDeclaration declares an external module.
                                 // This type of declaration is permitted only in the global module.
                                 // The StringLiteral must specify a top - level external module name.
@@ -1298,7 +1435,7 @@ namespace ts {
             if (file.imports.length || file.moduleAugmentations.length) {
                 file.resolvedModules = createMap<ResolvedModuleFull>();
                 const moduleNames = map(concatenate(file.imports, file.moduleAugmentations), getTextOfLiteral);
-                const resolutions = resolveModuleNamesWorker(moduleNames, getNormalizedAbsolutePath(file.fileName, currentDirectory));
+                const resolutions = resolveModuleNamesReusingOldState(moduleNames, getNormalizedAbsolutePath(file.fileName, currentDirectory), file);
                 Debug.assert(resolutions.length === moduleNames.length);
                 for (let i = 0; i < moduleNames.length; i++) {
                     const resolution = resolutions[i];
@@ -1548,13 +1685,24 @@ namespace ts {
                     const emitFilePath = toPath(emitFileName, currentDirectory, getCanonicalFileName);
                     // Report error if the output overwrites input file
                     if (filesByName.contains(emitFilePath)) {
-                        createEmitBlockingDiagnostics(emitFileName, Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file);
+                        if (options.noEmitOverwritenFiles && !options.out && !options.outDir && !options.outFile) {
+                            blockEmittingOfFile(emitFileName);
+                        }
+                        else {
+                            let chain: DiagnosticMessageChain;
+                            if (!options.configFilePath) {
+                                // The program is from either an inferred project or an external project
+                                chain = chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig);
+                            }
+                            chain = chainDiagnosticMessages(chain, Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName);
+                            blockEmittingOfFile(emitFileName, createCompilerDiagnosticFromMessageChain(chain));
+                        }
                     }
 
                     // Report error if multiple files write into same file
                     if (emitFilesSeen.contains(emitFilePath)) {
                         // Already seen the same emit file - report error
-                        createEmitBlockingDiagnostics(emitFileName, Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files);
+                        blockEmittingOfFile(emitFileName, createCompilerDiagnostic(Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files, emitFileName));
                     }
                     else {
                         emitFilesSeen.set(emitFilePath, true);
@@ -1563,9 +1711,11 @@ namespace ts {
             }
         }
 
-        function createEmitBlockingDiagnostics(emitFileName: string, message: DiagnosticMessage) {
+        function blockEmittingOfFile(emitFileName: string, diag?: Diagnostic) {
             hasEmitBlockingDiagnostics.set(toPath(emitFileName, currentDirectory, getCanonicalFileName), true);
-            programDiagnostics.add(createCompilerDiagnostic(message, emitFileName));
+            if (diag) {
+                programDiagnostics.add(diag);
+            }
         }
     }
 
diff --git a/src/compiler/transformers/jsx.ts b/src/compiler/transformers/jsx.ts
index 95a4016bb0aeb..9dbe83a6d3bc5 100644
--- a/src/compiler/transformers/jsx.ts
+++ b/src/compiler/transformers/jsx.ts
@@ -86,7 +86,7 @@ namespace ts {
         function visitJsxOpeningLikeElement(node: JsxOpeningLikeElement, children: JsxChild[], isChild: boolean, location: TextRange) {
             const tagName = getTagName(node);
             let objectProperties: Expression;
-            const attrs = node.attributes;
+            const attrs = node.attributes.properties;
             if (attrs.length === 0) {
                 // When there are no attributes, React wants "null"
                 objectProperties = createNull();
diff --git a/src/compiler/types.ts b/src/compiler/types.ts
index 3f40272bd4cc4..fcfc3992ceb53 100644
--- a/src/compiler/types.ts
+++ b/src/compiler/types.ts
@@ -308,6 +308,7 @@ namespace ts {
         JsxOpeningElement,
         JsxClosingElement,
         JsxAttribute,
+        JsxAttributes,
         JsxSpreadAttribute,
         JsxExpression,
 
@@ -704,6 +705,7 @@ namespace ts {
     // SyntaxKind.BindingElement
     // SyntaxKind.Property
     // SyntaxKind.PropertyAssignment
+    // SyntaxKind.JsxAttribute
     // SyntaxKind.ShorthandPropertyAssignment
     // SyntaxKind.EnumMember
     // SyntaxKind.JSDocPropertyTag
@@ -1372,7 +1374,7 @@ namespace ts {
         template: TemplateLiteral;
     }
 
-    export type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator;
+    export type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator | JsxOpeningLikeElement;
 
     export interface AsExpression extends Expression {
         kind: SyntaxKind.AsExpression;
@@ -1401,35 +1403,39 @@ namespace ts {
         closingElement: JsxClosingElement;
     }
 
+    /// Either the opening tag in a <Tag>...</Tag> pair, or the lone <Tag /> in a self-closing form
+    export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement;
+
+    export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute;
+
     export type JsxTagNameExpression = PrimaryExpression | PropertyAccessExpression;
 
+    export interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
+    }
+
     /// The opening element of a <Tag>...</Tag> JsxElement
     export interface JsxOpeningElement extends Expression {
         kind: SyntaxKind.JsxOpeningElement;
         tagName: JsxTagNameExpression;
-        attributes: NodeArray<JsxAttribute | JsxSpreadAttribute>;
+        attributes: JsxAttributes;
     }
 
     /// A JSX expression of the form <TagName attrs />
     export interface JsxSelfClosingElement extends PrimaryExpression {
         kind: SyntaxKind.JsxSelfClosingElement;
         tagName: JsxTagNameExpression;
-        attributes: NodeArray<JsxAttribute | JsxSpreadAttribute>;
+        attributes: JsxAttributes;
     }
 
-    /// Either the opening tag in a <Tag>...</Tag> pair, or the lone <Tag /> in a self-closing form
-    export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement;
-
-    export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute;
-
-    export interface JsxAttribute extends Node {
-        kind: SyntaxKind.JsxAttribute;
+    // @kind(SyntaxKind.JsxAttribute)
+    export interface JsxAttribute extends ObjectLiteralElement {
         name: Identifier;
         /// JSX attribute initializers are optional; <X y /> is sugar for <X y={true} />
         initializer?: StringLiteral | JsxExpression;
     }
 
-    export interface JsxSpreadAttribute extends Node {
+    // @kind(SyntaxKind.JsxSpreadAttribute)
+    export interface JsxSpreadAttribute extends ObjectLiteralElement {
         kind: SyntaxKind.JsxSpreadAttribute;
         expression: Expression;
     }
@@ -2107,6 +2113,7 @@ namespace ts {
         /* @internal */ imports: LiteralExpression[];
         /* @internal */ moduleAugmentations: LiteralExpression[];
         /* @internal */ patternAmbientModules?: PatternAmbientModule[];
+        /* @internal */ ambientModuleNames: string[];
         // The synthesized identifier for an imported external helpers module.
         /* @internal */ externalHelpersModuleName?: Identifier;
     }
@@ -2296,11 +2303,13 @@ namespace ts {
         getAliasedSymbol(symbol: Symbol): Symbol;
         getExportsOfModule(moduleSymbol: Symbol): Symbol[];
 
-        getJsxElementAttributesType(elementNode: JsxOpeningLikeElement): Type;
+        getAllAttributesTypeFromJsxOpeningLikeElement(elementNode: JsxOpeningLikeElement): Type;
         getJsxIntrinsicTagNames(): Symbol[];
         isOptionalParameter(node: ParameterDeclaration): boolean;
         getAmbientModules(): Symbol[];
 
+        /* @internal */ tryFindAmbientModuleWithoutAugmentations(moduleName: string): Symbol;
+
         // Should not be called directly.  Should only be accessed through the Program instance.
         /* @internal */ getDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[];
         /* @internal */ getGlobalDiagnostics(): Diagnostic[];
@@ -2667,7 +2676,7 @@ namespace ts {
         isVisible?: boolean;              // Is this node visible
         hasReportedStatementInAmbientContext?: boolean;  // Cache boolean if we report statements in ambient context
         jsxFlags?: JsxFlags;              // flags for knowing what kind of element/attributes we're dealing with
-        resolvedJsxType?: Type;           // resolved element attributes type of a JSX openinglike element
+        resolvedJsxElementAttributesType?: Type;  // resolved element attributes type of a JSX openinglike element
         hasSuperCall?: boolean;           // recorded result when we try to find super-call. We only try to find one if this flag is undefined, indicating that we haven't made an attempt.
         superCall?: ExpressionStatement;  // Cached first super-call found in the constructor. Used in checking whether super is called before this-accessing
         switchTypes?: Type[];             // Cached array of switch case expression types
@@ -2702,6 +2711,8 @@ namespace ts {
         ContainsObjectLiteral   = 1 << 22,  // Type is or contains object literal type
         /* @internal */
         ContainsAnyFunctionType = 1 << 23,  // Type is or contains object literal type
+        /* @internal */
+        JsxAttributes           = 1 << 24,  // Jsx attributes type
 
         /* @internal */
         Nullable = Undefined | Null,
@@ -2720,7 +2731,7 @@ namespace ts {
         EnumLike = Enum | EnumLiteral,
         UnionOrIntersection = Union | Intersection,
         StructuredType = Object | Union | Intersection,
-        StructuredOrTypeParameter = StructuredType | TypeParameter,
+        StructuredOrTypeParameter = StructuredType | TypeParameter | Index,
 
         // 'Narrowable' types are types where narrowing actually narrows.
         // This *should* be every type other than null, undefined, void, and never
@@ -2864,7 +2875,7 @@ namespace ts {
 
     /* @internal */
     // Object literals are initially marked fresh. Freshness disappears following an assignment,
-    // before a type assertion, or when when an object literal's type is widened. The regular
+    // before a type assertion, or when  an object literal's type is widened. The regular
     // version of a fresh type is identical except for the TypeFlags.FreshObjectLiteral flag.
     export interface FreshObjectLiteralType extends ResolvedType {
         regularType: ResolvedType;  // Regular version of fresh type
@@ -3069,6 +3080,7 @@ namespace ts {
         moduleResolution?: ModuleResolutionKind;
         newLine?: NewLineKind;
         noEmit?: boolean;
+        /*@internal*/noEmitOverwritenFiles?: boolean;
         noEmitHelpers?: boolean;
         noEmitOnError?: boolean;
         noErrorTruncation?: boolean;
diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts
index b668fe6eb1582..8561d23ed5589 100644
--- a/src/compiler/utilities.ts
+++ b/src/compiler/utilities.ts
@@ -1073,6 +1073,8 @@ namespace ts {
 
     export function isCallLikeExpression(node: Node): node is CallLikeExpression {
         switch (node.kind) {
+            case SyntaxKind.JsxOpeningElement:
+            case SyntaxKind.JsxSelfClosingElement:
             case SyntaxKind.CallExpression:
             case SyntaxKind.NewExpression:
             case SyntaxKind.TaggedTemplateExpression:
@@ -1087,6 +1089,9 @@ namespace ts {
         if (node.kind === SyntaxKind.TaggedTemplateExpression) {
             return (<TaggedTemplateExpression>node).tag;
         }
+        else if (isJsxOpeningLikeElement(node)) {
+            return node.tagName;
+        }
 
         // Will either be a CallExpression, NewExpression, or Decorator.
         return (<CallExpression | Decorator>node).expression;
@@ -4132,6 +4137,7 @@ namespace ts {
             || kind === SyntaxKind.ImportEqualsDeclaration
             || kind === SyntaxKind.ImportSpecifier
             || kind === SyntaxKind.InterfaceDeclaration
+            || kind === SyntaxKind.JsxAttribute
             || kind === SyntaxKind.MethodDeclaration
             || kind === SyntaxKind.MethodSignature
             || kind === SyntaxKind.ModuleDeclaration
@@ -4244,6 +4250,11 @@ namespace ts {
             || kind === SyntaxKind.JsxText;
     }
 
+    export function isJsxAttributes(node: Node): node is JsxAttributes {
+        const kind = node.kind;
+        return kind === SyntaxKind.JsxAttributes;
+    }
+
     export function isJsxAttributeLike(node: Node): node is JsxAttributeLike {
         const kind = node.kind;
         return kind === SyntaxKind.JsxAttribute
@@ -4258,6 +4269,10 @@ namespace ts {
         return node.kind === SyntaxKind.JsxAttribute;
     }
 
+    export function isJsxOpeningLikeElement(node: Node): node is JsxOpeningLikeElement {
+        return node.kind === SyntaxKind.JsxOpeningElement || node.kind === SyntaxKind.JsxSelfClosingElement;
+    }
+
     export function isStringLiteralOrJsxExpression(node: Node): node is StringLiteral | JsxExpression {
         const kind = node.kind;
         return kind === SyntaxKind.StringLiteral
diff --git a/src/compiler/visitor.ts b/src/compiler/visitor.ts
index db59c30934507..c718c461b3f58 100644
--- a/src/compiler/visitor.ts
+++ b/src/compiler/visitor.ts
@@ -461,13 +461,17 @@ namespace ts {
             case SyntaxKind.JsxSelfClosingElement:
             case SyntaxKind.JsxOpeningElement:
                 result = reduceNode((<JsxSelfClosingElement | JsxOpeningElement>node).tagName, f, result);
-                result = reduceLeft((<JsxSelfClosingElement | JsxOpeningElement>node).attributes, f, result);
+                result = reduceNode((<JsxSelfClosingElement | JsxOpeningElement>node).attributes, f, result);
                 break;
 
             case SyntaxKind.JsxClosingElement:
                 result = reduceNode((<JsxClosingElement>node).tagName, f, result);
                 break;
 
+            case SyntaxKind.JsxAttributes:
+                result = reduceLeft((<JsxAttributes>node).properties, f, result);
+                break;
+
             case SyntaxKind.JsxAttribute:
                 result = reduceNode((<JsxAttribute>node).name, f, result);
                 result = reduceNode((<JsxAttribute>node).initializer, f, result);
@@ -557,6 +561,7 @@ namespace ts {
             return undefined;
         }
 
+        aggregateTransformFlags(node);
         const visited = visitor(node);
         if (visited === node) {
             return node;
@@ -625,6 +630,7 @@ namespace ts {
         // Visit each original node.
         for (let i = 0; i < count; i++) {
             const node = nodes[i + start];
+            aggregateTransformFlags(node);
             const visited = node !== undefined ? visitor(node) : undefined;
             if (updated !== undefined || visited === undefined || visited !== node) {
                 if (updated === undefined) {
@@ -1072,15 +1078,19 @@ namespace ts {
                     visitNodes((<JsxElement>node).children, visitor, isJsxChild),
                     visitNode((<JsxElement>node).closingElement, visitor, isJsxClosingElement));
 
+            case SyntaxKind.JsxAttributes:
+                return updateJsxAttributes(<JsxAttributes>node,
+                    visitNodes((<JsxAttributes>node).properties, visitor, isJsxAttributeLike));
+
             case SyntaxKind.JsxSelfClosingElement:
                 return updateJsxSelfClosingElement(<JsxSelfClosingElement>node,
                     visitNode((<JsxSelfClosingElement>node).tagName, visitor, isJsxTagNameExpression),
-                    visitNodes((<JsxSelfClosingElement>node).attributes, visitor, isJsxAttributeLike));
+                    visitNode((<JsxSelfClosingElement>node).attributes, visitor, isJsxAttributes));
 
             case SyntaxKind.JsxOpeningElement:
                 return updateJsxOpeningElement(<JsxOpeningElement>node,
                     visitNode((<JsxOpeningElement>node).tagName, visitor, isJsxTagNameExpression),
-                    visitNodes((<JsxOpeningElement>node).attributes, visitor, isJsxAttributeLike));
+                    visitNode((<JsxOpeningElement>node).attributes, visitor, isJsxAttributes));
 
             case SyntaxKind.JsxClosingElement:
                 return updateJsxClosingElement(<JsxClosingElement>node,
diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts
index b008ca653702d..ae32fe3db1631 100644
--- a/src/harness/fourslash.ts
+++ b/src/harness/fourslash.ts
@@ -1253,7 +1253,18 @@ namespace FourSlash {
                             resultString += "Diagnostics:" + Harness.IO.newLine();
                             const diagnostics = ts.getPreEmitDiagnostics(this.languageService.getProgram());
                             for (const diagnostic of diagnostics) {
-                                resultString += "  " + diagnostic.messageText + Harness.IO.newLine();
+                                if (typeof diagnostic.messageText !== "string") {
+                                    let chainedMessage = <ts.DiagnosticMessageChain>diagnostic.messageText;
+                                    let indentation = " ";
+                                    while (chainedMessage) {
+                                        resultString += indentation + chainedMessage.messageText + Harness.IO.newLine();
+                                        chainedMessage = chainedMessage.next;
+                                        indentation = indentation + " ";
+                                    }
+                                }
+                                else {
+                                    resultString += "  " + diagnostic.messageText + Harness.IO.newLine();
+                                }
                             }
                         }
 
diff --git a/src/harness/harness.ts b/src/harness/harness.ts
index 064853f9a0628..7e57c5f39f5c5 100644
--- a/src/harness/harness.ts
+++ b/src/harness/harness.ts
@@ -922,10 +922,15 @@ namespace Harness {
         export const defaultLibFileName = "lib.d.ts";
         export const es2015DefaultLibFileName = "lib.es2015.d.ts";
 
+        // Cache of lib files from "built/local"
         const libFileNameSourceFileMap = ts.createMap<ts.SourceFile>({
             [defaultLibFileName]: createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + "lib.es5.d.ts"), /*languageVersion*/ ts.ScriptTarget.Latest)
         });
 
+        // Cache of lib files from  "tests/lib/"
+        const testLibFileNameSourceFileMap = ts.createMap<ts.SourceFile>();
+        const es6TestLibFileNameSourceFileMap = ts.createMap<ts.SourceFile>();
+
         export function getDefaultLibrarySourceFile(fileName = defaultLibFileName): ts.SourceFile {
             if (!isDefaultLibraryFile(fileName)) {
                 return undefined;
@@ -966,7 +971,8 @@ namespace Harness {
             useCaseSensitiveFileNames: boolean,
             // the currentDirectory is needed for rwcRunner to passed in specified current directory to compiler host
             currentDirectory: string,
-            newLineKind?: ts.NewLineKind): ts.CompilerHost {
+            newLineKind?: ts.NewLineKind,
+            libFiles?: string): ts.CompilerHost {
 
             // Local get canonical file name function, that depends on passed in parameter for useCaseSensitiveFileNames
             const getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
@@ -988,6 +994,24 @@ namespace Harness {
                 }
             }
 
+            if (libFiles) {
+                // Because @libFiles don't change between execution. We would cache the result of the files and reuse it to speed help compilation
+                for (const fileName of libFiles.split(",")) {
+                    const libFileName = "tests/lib/" + fileName;
+
+                    if (scriptTarget <= ts.ScriptTarget.ES5) {
+                        if (!testLibFileNameSourceFileMap[libFileName]) {
+                            testLibFileNameSourceFileMap[libFileName] = createSourceFileAndAssertInvariants(libFileName, IO.readFile(libFileName), scriptTarget);
+                        }
+                    }
+                    else {
+                        if (!es6TestLibFileNameSourceFileMap[libFileName]) {
+                            es6TestLibFileNameSourceFileMap[libFileName] = createSourceFileAndAssertInvariants(libFileName, IO.readFile(libFileName), scriptTarget);
+                        }
+                    }
+                }
+            }
+
             function getSourceFile(fileName: string) {
                 fileName = ts.normalizePath(fileName);
                 const path = ts.toPath(fileName, currentDirectory, getCanonicalFileName);
@@ -999,6 +1023,9 @@ namespace Harness {
                     fourslashSourceFile = fourslashSourceFile || createSourceFileAndAssertInvariants(tsFn, Harness.IO.readFile(tsFn), scriptTarget);
                     return fourslashSourceFile;
                 }
+                else if (ts.startsWith(fileName, "tests/lib/")) {
+                    return scriptTarget <= ts.ScriptTarget.ES5 ? testLibFileNameSourceFileMap[fileName] : es6TestLibFileNameSourceFileMap[fileName];
+                }
                 else {
                     // Don't throw here -- the compiler might be looking for a test that actually doesn't exist as part of the TC
                     // Return if it is other library file, otherwise return undefined
@@ -1203,7 +1230,8 @@ namespace Harness {
             if (options.libFiles) {
                 for (const fileName of options.libFiles.split(",")) {
                     const libFileName = "tests/lib/" + fileName;
-                    programFiles.push({ unitName: libFileName, content: normalizeLineEndings(IO.readFile(libFileName), Harness.IO.newLine()) });
+                    // Content is undefined here because in createCompilerHost we will create sourceFile for the lib file and cache the result
+                    programFiles.push({ unitName: libFileName, content: undefined });
                 }
             }
 
@@ -1216,7 +1244,8 @@ namespace Harness {
                 options.target,
                 useCaseSensitiveFileNames,
                 currentDirectory,
-                options.newLine);
+                options.newLine,
+                options.libFiles);
 
             let traceResults: string[];
             if (options.traceResolution) {
diff --git a/src/harness/unittests/moduleResolution.ts b/src/harness/unittests/moduleResolution.ts
index 104d9f9e394eb..0e391445ebaff 100644
--- a/src/harness/unittests/moduleResolution.ts
+++ b/src/harness/unittests/moduleResolution.ts
@@ -1065,5 +1065,69 @@ import b = require("./moduleB");
             assert.equal(diagnostics2.length, 1, "expected one diagnostic");
             assert.equal(diagnostics1[0].messageText, diagnostics2[0].messageText, "expected one diagnostic");
         });
+
+        it ("Modules in the same .d.ts file are preferred to external files", () => {
+            const f = {
+                name: "/a/b/c/c/app.d.ts",
+                content: `
+                declare module "fs" {
+                    export interface Stat { id: number }
+                }
+                declare module "fs-client" {
+                    import { Stat } from "fs";
+                    export function foo(): Stat;
+                }`
+            };
+            const file = createSourceFile(f.name, f.content, ScriptTarget.ES2015);
+            const compilerHost: CompilerHost = {
+                fileExists : fileName => fileName === file.fileName,
+                getSourceFile: fileName => fileName === file.fileName ? file : undefined,
+                getDefaultLibFileName: () => "lib.d.ts",
+                writeFile: notImplemented,
+                getCurrentDirectory: () => "/",
+                getDirectories: () => [],
+                getCanonicalFileName: f => f.toLowerCase(),
+                getNewLine: () => "\r\n",
+                useCaseSensitiveFileNames: () => false,
+                readFile: fileName => fileName === file.fileName ? file.text : undefined,
+                resolveModuleNames() {
+                    assert(false, "resolveModuleNames should not be called");
+                    return undefined;
+                }
+            };
+            createProgram([f.name], {}, compilerHost);
+        });
+
+        it ("Modules in .ts file are not checked in the same file", () => {
+            const f = {
+                name: "/a/b/c/c/app.ts",
+                content: `
+                declare module "fs" {
+                    export interface Stat { id: number }
+                }
+                declare module "fs-client" {
+                    import { Stat } from "fs";
+                    export function foo(): Stat;
+                }`
+            };
+            const file = createSourceFile(f.name, f.content, ScriptTarget.ES2015);
+            const compilerHost: CompilerHost = {
+                fileExists : fileName => fileName === file.fileName,
+                getSourceFile: fileName => fileName === file.fileName ? file : undefined,
+                getDefaultLibFileName: () => "lib.d.ts",
+                writeFile: notImplemented,
+                getCurrentDirectory: () => "/",
+                getDirectories: () => [],
+                getCanonicalFileName: f => f.toLowerCase(),
+                getNewLine: () => "\r\n",
+                useCaseSensitiveFileNames: () => false,
+                readFile: fileName => fileName === file.fileName ? file.text : undefined,
+                resolveModuleNames(moduleNames: string[], _containingFile: string) {
+                    assert.deepEqual(moduleNames, ["fs"]);
+                    return [undefined];
+                }
+            };
+            createProgram([f.name], {}, compilerHost);
+        });
     });
 }
diff --git a/src/harness/unittests/reuseProgramStructure.ts b/src/harness/unittests/reuseProgramStructure.ts
index 215e05658a964..386e02e24507a 100644
--- a/src/harness/unittests/reuseProgramStructure.ts
+++ b/src/harness/unittests/reuseProgramStructure.ts
@@ -22,6 +22,11 @@ namespace ts {
 
     interface ProgramWithSourceTexts extends Program {
         sourceTexts?: NamedSourceText[];
+        host: TestCompilerHost;
+    }
+
+    interface TestCompilerHost extends CompilerHost {
+        getTrace(): string[];
     }
 
     class SourceText implements IScriptSnapshot {
@@ -101,10 +106,21 @@ namespace ts {
         return file;
     }
 
-    function createTestCompilerHost(texts: NamedSourceText[], target: ScriptTarget): CompilerHost {
-        const files = arrayToMap(texts, t => t.name, t => createSourceFileWithText(t.name, t.text, target));
+    function createTestCompilerHost(texts: NamedSourceText[], target: ScriptTarget, oldProgram?: ProgramWithSourceTexts): TestCompilerHost {
+        const files = arrayToMap(texts, t => t.name, t => {
+            if (oldProgram) {
+                const oldFile = <SourceFileWithText>oldProgram.getSourceFile(t.name);
+                if (oldFile && oldFile.sourceText.getVersion() === t.text.getVersion()) {
+                    return oldFile;
+                }
+            }
+            return createSourceFileWithText(t.name, t.text, target);
+        });
+        const trace: string[] = [];
 
         return {
+            trace: s => trace.push(s),
+            getTrace: () => trace,
             getSourceFile(fileName): SourceFile {
                 return files[fileName];
             },
@@ -130,23 +146,25 @@ namespace ts {
             fileExists: fileName => fileName in files,
             readFile: fileName => {
                 return fileName in files ? files[fileName].text : undefined;
-            }
+            },
         };
     }
 
-    function newProgram(texts: NamedSourceText[], rootNames: string[], options: CompilerOptions): Program {
+    function newProgram(texts: NamedSourceText[], rootNames: string[], options: CompilerOptions): ProgramWithSourceTexts {
         const host = createTestCompilerHost(texts, options.target);
         const program = <ProgramWithSourceTexts>createProgram(rootNames, options, host);
         program.sourceTexts = texts;
+        program.host = host;
         return program;
     }
 
-    function updateProgram(oldProgram: Program, rootNames: string[], options: CompilerOptions, updater: (files: NamedSourceText[]) => void) {
+    function updateProgram(oldProgram: ProgramWithSourceTexts, rootNames: string[], options: CompilerOptions, updater: (files: NamedSourceText[]) => void) {
         const texts: NamedSourceText[] = (<ProgramWithSourceTexts>oldProgram).sourceTexts.slice(0);
         updater(texts);
-        const host = createTestCompilerHost(texts, options.target);
+        const host = createTestCompilerHost(texts, options.target, oldProgram);
         const program = <ProgramWithSourceTexts>createProgram(rootNames, options, host, oldProgram);
         program.sourceTexts = texts;
+        program.host = host;
         return program;
     }
 
@@ -355,6 +373,112 @@ namespace ts {
             assert.isTrue(!program_3.structureIsReused);
             checkResolvedTypeDirectivesCache(program_1, "/a.ts", createMap({ "typedefs": { resolvedFileName: "/types/typedefs/index.d.ts", primary: true } }));
         });
+
+        it("can reuse ambient module declarations from non-modified files", () => {
+            const files = [
+                { name: "/a/b/app.ts", text: SourceText.New("", "import * as fs from 'fs'", "") },
+                { name: "/a/b/node.d.ts", text: SourceText.New("", "", "declare module 'fs' {}") }
+            ];
+            const options = { target: ScriptTarget.ES2015, traceResolution: true };
+            const program = newProgram(files, files.map(f => f.name), options);
+            assert.deepEqual(program.host.getTrace(),
+                [
+                    "======== Resolving module 'fs' from '/a/b/app.ts'. ========",
+                    "Module resolution kind is not specified, using 'Classic'.",
+                    "File '/a/b/fs.ts' does not exist.",
+                    "File '/a/b/fs.tsx' does not exist.",
+                    "File '/a/b/fs.d.ts' does not exist.",
+                    "File '/a/fs.ts' does not exist.",
+                    "File '/a/fs.tsx' does not exist.",
+                    "File '/a/fs.d.ts' does not exist.",
+                    "File '/fs.ts' does not exist.",
+                    "File '/fs.tsx' does not exist.",
+                    "File '/fs.d.ts' does not exist.",
+                    "File '/a/b/node_modules/@types/fs.ts' does not exist.",
+                    "File '/a/b/node_modules/@types/fs.tsx' does not exist.",
+                    "File '/a/b/node_modules/@types/fs.d.ts' does not exist.",
+                    "File '/a/b/node_modules/@types/fs/package.json' does not exist.",
+                    "File '/a/b/node_modules/@types/fs/index.ts' does not exist.",
+                    "File '/a/b/node_modules/@types/fs/index.tsx' does not exist.",
+                    "File '/a/b/node_modules/@types/fs/index.d.ts' does not exist.",
+                    "File '/a/node_modules/@types/fs.ts' does not exist.",
+                    "File '/a/node_modules/@types/fs.tsx' does not exist.",
+                    "File '/a/node_modules/@types/fs.d.ts' does not exist.",
+                    "File '/a/node_modules/@types/fs/package.json' does not exist.",
+                    "File '/a/node_modules/@types/fs/index.ts' does not exist.",
+                    "File '/a/node_modules/@types/fs/index.tsx' does not exist.",
+                    "File '/a/node_modules/@types/fs/index.d.ts' does not exist.",
+                    "File '/node_modules/@types/fs.ts' does not exist.",
+                    "File '/node_modules/@types/fs.tsx' does not exist.",
+                    "File '/node_modules/@types/fs.d.ts' does not exist.",
+                    "File '/node_modules/@types/fs/package.json' does not exist.",
+                    "File '/node_modules/@types/fs/index.ts' does not exist.",
+                    "File '/node_modules/@types/fs/index.tsx' does not exist.",
+                    "File '/node_modules/@types/fs/index.d.ts' does not exist.",
+                    "File '/a/b/fs.js' does not exist.",
+                    "File '/a/b/fs.jsx' does not exist.",
+                    "File '/a/fs.js' does not exist.",
+                    "File '/a/fs.jsx' does not exist.",
+                    "File '/fs.js' does not exist.",
+                    "File '/fs.jsx' does not exist.",
+                    "======== Module name 'fs' was not resolved. ========",
+                ], "should look for 'fs'");
+
+            const program_2 = updateProgram(program, program.getRootFileNames(), options, f => {
+                f[0].text = f[0].text.updateProgram("var x = 1;");
+            });
+            assert.deepEqual(program_2.host.getTrace(), [
+                "Module 'fs' was resolved as ambient module declared in '/a/b/node.d.ts' since this file was not modified."
+            ], "should reuse 'fs' since node.d.ts was not changed");
+
+            const program_3 = updateProgram(program_2, program_2.getRootFileNames(), options, f => {
+                f[0].text = f[0].text.updateProgram("var y = 1;");
+                f[1].text = f[1].text.updateProgram("declare var process: any");
+            });
+            assert.deepEqual(program_3.host.getTrace(),
+                [
+                    "======== Resolving module 'fs' from '/a/b/app.ts'. ========",
+                    "Module resolution kind is not specified, using 'Classic'.",
+                    "File '/a/b/fs.ts' does not exist.",
+                    "File '/a/b/fs.tsx' does not exist.",
+                    "File '/a/b/fs.d.ts' does not exist.",
+                    "File '/a/fs.ts' does not exist.",
+                    "File '/a/fs.tsx' does not exist.",
+                    "File '/a/fs.d.ts' does not exist.",
+                    "File '/fs.ts' does not exist.",
+                    "File '/fs.tsx' does not exist.",
+                    "File '/fs.d.ts' does not exist.",
+                    "File '/a/b/node_modules/@types/fs.ts' does not exist.",
+                    "File '/a/b/node_modules/@types/fs.tsx' does not exist.",
+                    "File '/a/b/node_modules/@types/fs.d.ts' does not exist.",
+                    "File '/a/b/node_modules/@types/fs/package.json' does not exist.",
+                    "File '/a/b/node_modules/@types/fs/index.ts' does not exist.",
+                    "File '/a/b/node_modules/@types/fs/index.tsx' does not exist.",
+                    "File '/a/b/node_modules/@types/fs/index.d.ts' does not exist.",
+                    "File '/a/node_modules/@types/fs.ts' does not exist.",
+                    "File '/a/node_modules/@types/fs.tsx' does not exist.",
+                    "File '/a/node_modules/@types/fs.d.ts' does not exist.",
+                    "File '/a/node_modules/@types/fs/package.json' does not exist.",
+                    "File '/a/node_modules/@types/fs/index.ts' does not exist.",
+                    "File '/a/node_modules/@types/fs/index.tsx' does not exist.",
+                    "File '/a/node_modules/@types/fs/index.d.ts' does not exist.",
+                    "File '/node_modules/@types/fs.ts' does not exist.",
+                    "File '/node_modules/@types/fs.tsx' does not exist.",
+                    "File '/node_modules/@types/fs.d.ts' does not exist.",
+                    "File '/node_modules/@types/fs/package.json' does not exist.",
+                    "File '/node_modules/@types/fs/index.ts' does not exist.",
+                    "File '/node_modules/@types/fs/index.tsx' does not exist.",
+                    "File '/node_modules/@types/fs/index.d.ts' does not exist.",
+                    "File '/a/b/fs.js' does not exist.",
+                    "File '/a/b/fs.jsx' does not exist.",
+                    "File '/a/fs.js' does not exist.",
+                    "File '/a/fs.jsx' does not exist.",
+                    "File '/fs.js' does not exist.",
+                    "File '/fs.jsx' does not exist.",
+                    "======== Module name 'fs' was not resolved. ========",
+                ], "should look for 'fs' again since node.d.ts was changed");
+
+        });
     });
 
     describe("host is optional", () => {
diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts
index 870926a8c5595..15cfa3f8c8e7c 100644
--- a/src/harness/unittests/tsserverProjectSystem.ts
+++ b/src/harness/unittests/tsserverProjectSystem.ts
@@ -2505,4 +2505,28 @@ namespace ts.projectSystem {
             checkProjectActualFiles(projectService.inferredProjects[0], [f.path]);
         });
     });
+
+    describe("No overwrite emit error", () => {
+        it("for inferred project", () => {
+            const f1 = {
+                path: "/a/b/f1.js",
+                content: "function test1() { }"
+            };
+            const host = createServerHost([f1, libFile]);
+            const session = createSession(host);
+            openFilesForSession([f1], session);
+
+            const projectService = session.getProjectService();
+            checkNumberOfProjects(projectService, { inferredProjects: 1 });
+            const projectName = projectService.inferredProjects[0].getProjectName();
+
+            const diags = session.executeCommand(<server.protocol.CompilerOptionsDiagnosticsRequest>{
+                type: "request",
+                command: server.CommandNames.CompilerOptionsDiagnosticsFull,
+                seq: 2,
+                arguments: { projectFileName: projectName }
+            }).response;
+            assert.isTrue(diags.length === 0);
+        });
+    });
 }
\ No newline at end of file
diff --git a/src/server/project.ts b/src/server/project.ts
index 457f5e2b261df..563b045691071 100644
--- a/src/server/project.ts
+++ b/src/server/project.ts
@@ -161,6 +161,10 @@ namespace ts.server {
                 this.compilerOptions.allowNonTsExtensions = true;
             }
 
+            if (this.projectKind === ProjectKind.Inferred) {
+                this.compilerOptions.noEmitOverwritenFiles = true;
+            }
+
             if (languageServiceEnabled) {
                 this.enableLanguageService();
             }
diff --git a/src/services/completions.ts b/src/services/completions.ts
index b710aa8cd78bb..da0e0b87e0334 100644
--- a/src/services/completions.ts
+++ b/src/services/completions.ts
@@ -1030,10 +1030,10 @@ namespace ts.Completions {
                 let attrsType: Type;
                 if ((jsxContainer.kind === SyntaxKind.JsxSelfClosingElement) || (jsxContainer.kind === SyntaxKind.JsxOpeningElement)) {
                     // Cursor is inside a JSX self-closing element or opening element
-                    attrsType = typeChecker.getJsxElementAttributesType(<JsxOpeningLikeElement>jsxContainer);
+                    attrsType = typeChecker.getAllAttributesTypeFromJsxOpeningLikeElement(<JsxOpeningLikeElement>jsxContainer);
 
                     if (attrsType) {
-                        symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), (<JsxOpeningLikeElement>jsxContainer).attributes);
+                        symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), (<JsxOpeningLikeElement>jsxContainer).attributes.properties);
                         isMemberCompletion = true;
                         isNewIdentifierLocation = false;
                         return true;
@@ -1375,13 +1375,18 @@ namespace ts.Completions {
                     case SyntaxKind.LessThanSlashToken:
                     case SyntaxKind.SlashToken:
                     case SyntaxKind.Identifier:
+                    case SyntaxKind.JsxAttributes:
                     case SyntaxKind.JsxAttribute:
                     case SyntaxKind.JsxSpreadAttribute:
                         if (parent && (parent.kind === SyntaxKind.JsxSelfClosingElement || parent.kind === SyntaxKind.JsxOpeningElement)) {
                             return <JsxOpeningLikeElement>parent;
                         }
                         else if (parent.kind === SyntaxKind.JsxAttribute) {
-                            return <JsxOpeningLikeElement>parent.parent;
+                            // Currently we parse JsxOpeninLikeElement as:
+                            //      JsxOpeninLikeElement
+                            //          attributes: JsxAttributes
+                            //             properties: NodeArray<JsxAttributeLike>
+                            return /*properties list*/parent./*attributes*/parent.parent as JsxOpeningLikeElement;
                         }
                         break;
 
@@ -1390,7 +1395,11 @@ namespace ts.Completions {
                     // whose parent is a JsxOpeningLikeElement
                     case SyntaxKind.StringLiteral:
                         if (parent && ((parent.kind === SyntaxKind.JsxAttribute) || (parent.kind === SyntaxKind.JsxSpreadAttribute))) {
-                            return <JsxOpeningLikeElement>parent.parent;
+                            // Currently we parse JsxOpeninLikeElement as:
+                            //      JsxOpeninLikeElement
+                            //          attributes: JsxAttributes
+                            //             properties: NodeArray<JsxAttributeLike>
+                            return /*properties list*/parent./*attributes*/parent.parent as JsxOpeningLikeElement;
                         }
 
                         break;
@@ -1398,13 +1407,21 @@ namespace ts.Completions {
                     case SyntaxKind.CloseBraceToken:
                         if (parent &&
                             parent.kind === SyntaxKind.JsxExpression &&
-                            parent.parent &&
-                            (parent.parent.kind === SyntaxKind.JsxAttribute)) {
-                            return <JsxOpeningLikeElement>parent.parent.parent;
+                            parent.parent && parent.parent.kind === SyntaxKind.JsxAttribute) {
+                            // Currently we parse JsxOpeninLikeElement as:
+                            //      JsxOpeninLikeElement
+                            //          attributes: JsxAttributes
+                            //             properties: NodeArray<JsxAttributeLike>
+                            //                  each JsxAttribute can have initializer as JsxExpression
+                            return /*JsxExpression*/parent./*JsxAttribute*/parent./*JsxAttributes*/parent.parent as JsxOpeningLikeElement;
                         }
 
                         if (parent && parent.kind === SyntaxKind.JsxSpreadAttribute) {
-                            return <JsxOpeningLikeElement>parent.parent;
+                            // Currently we parse JsxOpeninLikeElement as:
+                            //      JsxOpeninLikeElement
+                            //          attributes: JsxAttributes
+                            //             properties: NodeArray<JsxAttributeLike>
+                            return /*properties list*/parent./*attributes*/parent.parent as JsxOpeningLikeElement;
                         }
 
                         break;
diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts
index 9765780ee7c8f..549be662b81c5 100644
--- a/src/services/findAllReferences.ts
+++ b/src/services/findAllReferences.ts
@@ -1000,7 +1000,7 @@ namespace ts.FindAllReferences {
             // to get a contextual type for it, and add the property symbol from the contextual
             // type to the search set
             if (containingObjectLiteralElement) {
-                forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement), contextualSymbol => {
+                forEach(getPropertySymbolsFromContextualType(typeChecker, containingObjectLiteralElement), contextualSymbol => {
                     addRange(result, typeChecker.getRootSymbols(contextualSymbol));
                 });
 
@@ -1130,7 +1130,7 @@ namespace ts.FindAllReferences {
             // compare to our searchSymbol
             const containingObjectLiteralElement = getContainingObjectLiteralElement(referenceLocation);
             if (containingObjectLiteralElement) {
-                const contextualSymbol = forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement), contextualSymbol => {
+                const contextualSymbol = forEach(getPropertySymbolsFromContextualType(typeChecker, containingObjectLiteralElement), contextualSymbol => {
                     return forEach(typeChecker.getRootSymbols(contextualSymbol), s => searchSymbols.indexOf(s) >= 0 ? s : undefined);
                 });
 
@@ -1138,7 +1138,7 @@ namespace ts.FindAllReferences {
                     return contextualSymbol;
                 }
 
-                // If the reference location is the name of property from object literal destructuring pattern
+                // If the reference location is the name of property from object literal destructing pattern
                 // Get the property symbol from the object literal's type and look if thats the search symbol
                 // In below eg. get 'property' from type of elems iterating type
                 //      for ( { property: p2 } of elems) { }
@@ -1184,42 +1184,6 @@ namespace ts.FindAllReferences {
             });
         }
 
-        function getNameFromObjectLiteralElement(node: ObjectLiteralElement) {
-            if (node.name.kind === SyntaxKind.ComputedPropertyName) {
-                const nameExpression = (<ComputedPropertyName>node.name).expression;
-                // treat computed property names where expression is string/numeric literal as just string/numeric literal
-                if (isStringOrNumericLiteral(nameExpression.kind)) {
-                    return (<LiteralExpression>nameExpression).text;
-                }
-                return undefined;
-            }
-            return (<Identifier | LiteralExpression>node.name).text;
-        }
-
-        function getPropertySymbolsFromContextualType(node: ObjectLiteralElement): Symbol[] {
-            const objectLiteral = <ObjectLiteralExpression>node.parent;
-            const contextualType = typeChecker.getContextualType(objectLiteral);
-            const name = getNameFromObjectLiteralElement(node);
-            if (name && contextualType) {
-                const result: Symbol[] = [];
-                const symbol = contextualType.getProperty(name);
-                if (symbol) {
-                    result.push(symbol);
-                }
-
-                if (contextualType.flags & TypeFlags.Union) {
-                    forEach((<UnionType>contextualType).types, t => {
-                        const symbol = t.getProperty(name);
-                        if (symbol) {
-                            result.push(symbol);
-                        }
-                    });
-                }
-                return result;
-            }
-            return undefined;
-        }
-
         /** Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations
              * of the corresponding symbol. e.g. if we are searching for "Foo" in value position, but "Foo" references a class
             * then we need to widen the search to include type positions as well.
@@ -1361,35 +1325,6 @@ namespace ts.FindAllReferences {
         });
     }
 
-    /**
-     * Returns the containing object literal property declaration given a possible name node, e.g. "a" in x = { "a": 1 }
-     */
-    function getContainingObjectLiteralElement(node: Node): ObjectLiteralElement {
-        switch (node.kind) {
-            case SyntaxKind.StringLiteral:
-            case SyntaxKind.NumericLiteral:
-                if (node.parent.kind === SyntaxKind.ComputedPropertyName) {
-                    return isObjectLiteralPropertyDeclaration(node.parent.parent) ? node.parent.parent : undefined;
-                }
-            // intential fall through
-            case SyntaxKind.Identifier:
-                return isObjectLiteralPropertyDeclaration(node.parent) && node.parent.name === node ? node.parent : undefined;
-        }
-        return undefined;
-    }
-
-    function isObjectLiteralPropertyDeclaration(node: Node): node is ObjectLiteralElement  {
-        switch (node.kind) {
-            case SyntaxKind.PropertyAssignment:
-            case SyntaxKind.ShorthandPropertyAssignment:
-            case SyntaxKind.MethodDeclaration:
-            case SyntaxKind.GetAccessor:
-            case SyntaxKind.SetAccessor:
-                return true;
-        }
-        return false;
-    }
-
     /** Get `C` given `N` if `N` is in the position `class C extends N` or `class C extends foo.N` where `N` is an identifier. */
     function tryGetClassByExtendingIdentifier(node: Node): ClassLikeDeclaration | undefined {
         return tryGetClassExtendingExpressionWithTypeArguments(climbPastPropertyAccess(node).parent);
diff --git a/src/services/goToDefinition.ts b/src/services/goToDefinition.ts
index 4c005640d6ae8..047987cf49b1a 100644
--- a/src/services/goToDefinition.ts
+++ b/src/services/goToDefinition.ts
@@ -87,6 +87,39 @@ namespace ts.GoToDefinition {
                 declaration => createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName));
         }
 
+        if (isJsxOpeningLikeElement(node.parent)) {
+            // For JSX opening-like element, the tag can be resolved either as stateful component (e.g class) or stateless function component.
+            // Because if it is a stateless function component with an error while trying to resolve the signature, we don't want to return all
+            // possible overloads but just the first one.
+            // For example:
+            //      /*firstSource*/declare function MainButton(buttonProps: ButtonProps): JSX.Element;
+            //      /*secondSource*/declare function MainButton(linkProps: LinkProps): JSX.Element;
+            //      /*thirdSource*/declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
+            //      let opt = <Main/*firstTarget*/Button />;  // We get undefined for resolved signature indicating an error, then just return the first declaration
+            const {symbolName, symbolKind, containerName}  = getSymbolInfo(typeChecker, symbol, node);
+            return [createDefinitionInfo(symbol.valueDeclaration, symbolKind, symbolName, containerName)];
+        }
+
+        // If the current location we want to find its definition is in an object literal, try to get the contextual type for the
+        // object literal, lookup the property symbol in the contextual type, and use this for goto-definition.
+        // For example
+        //      interface Props{
+        //          /first*/prop1: number
+        //          prop2: boolean
+        //      }
+        //      function Foo(arg: Props) {}
+        //      Foo( { pr/*1*/op1: 10, prop2: true })
+        const container = getContainingObjectLiteralElement(node);
+        if (container) {
+            const contextualType = typeChecker.getContextualType(node.parent.parent as Expression);
+            if (contextualType) {
+                let result: DefinitionInfo[] = [];
+                forEach(getPropertySymbolsFromContextualType(typeChecker, container), contextualSymbol => {
+                    result = result.concat(getDefinitionFromSymbol(typeChecker, contextualSymbol, node));
+                });
+                return result;
+            }
+        }
         return getDefinitionFromSymbol(typeChecker, symbol, node);
     }
 
@@ -251,6 +284,11 @@ namespace ts.GoToDefinition {
 
     function tryGetSignatureDeclaration(typeChecker: TypeChecker, node: Node): SignatureDeclaration | undefined {
         const callLike = getAncestorCallLikeExpression(node);
-        return callLike && typeChecker.getResolvedSignature(callLike).declaration;
+        if (callLike) {
+            const resolvedSignature = typeChecker.getResolvedSignature(callLike);
+            // We have to check that resolvedSignature is not undefined because in the case of JSX opening-like element,
+            // it may not be a stateless function component which then will cause getResolvedSignature to return undefined.
+            return resolvedSignature && resolvedSignature.declaration;
+        }
     }
 }
diff --git a/src/services/services.ts b/src/services/services.ts
index 8c11c707e5d60..5ddae70d05a07 100644
--- a/src/services/services.ts
+++ b/src/services/services.ts
@@ -472,6 +472,7 @@ namespace ts {
         public imports: LiteralExpression[];
         public moduleAugmentations: LiteralExpression[];
         private namedDeclarations: Map<Declaration[]>;
+        public ambientModuleNames: string[];
 
         constructor(kind: SyntaxKind, pos: number, end: number) {
             super(kind, pos, end);
@@ -1966,6 +1967,76 @@ namespace ts {
         }
     }
 
+    function isObjectLiteralPropertyDeclaration(node: Node): node is ObjectLiteralElement  {
+        switch (node.kind) {
+            case SyntaxKind.JsxAttribute:
+            case SyntaxKind.PropertyAssignment:
+            case SyntaxKind.ShorthandPropertyAssignment:
+            case SyntaxKind.MethodDeclaration:
+            case SyntaxKind.GetAccessor:
+            case SyntaxKind.SetAccessor:
+                return true;
+        }
+        return false;
+    }
+
+    function getNameFromObjectLiteralElement(node: ObjectLiteralElement) {
+        if (node.name.kind === SyntaxKind.ComputedPropertyName) {
+            const nameExpression = (<ComputedPropertyName>node.name).expression;
+            // treat computed property names where expression is string/numeric literal as just string/numeric literal
+            if (isStringOrNumericLiteral(nameExpression.kind)) {
+                return (<LiteralExpression>nameExpression).text;
+            }
+            return undefined;
+        }
+        return (<Identifier | LiteralExpression>node.name).text;
+    }
+
+    /**
+     * Returns the containing object literal property declaration given a possible name node, e.g. "a" in x = { "a": 1 }
+     */
+    /* @internal */
+    export function getContainingObjectLiteralElement(node: Node): ObjectLiteralElement {
+        switch (node.kind) {
+            case SyntaxKind.StringLiteral:
+            case SyntaxKind.NumericLiteral:
+                if (node.parent.kind === SyntaxKind.ComputedPropertyName) {
+                    return isObjectLiteralPropertyDeclaration(node.parent.parent) ? node.parent.parent : undefined;
+                }
+            // intentionally fall through
+            case SyntaxKind.Identifier:
+                return isObjectLiteralPropertyDeclaration(node.parent) &&
+                    (node.parent.parent.kind === SyntaxKind.ObjectLiteralExpression || node.parent.parent.kind === SyntaxKind.JsxAttributes) &&
+                    (<ObjectLiteralElement>node.parent).name === node ? node.parent as ObjectLiteralElement : undefined;
+        }
+        return undefined;
+    }
+
+    /* @internal */
+    export function getPropertySymbolsFromContextualType(typeChecker: TypeChecker, node: ObjectLiteralElement): Symbol[] {
+            const objectLiteral = <ObjectLiteralExpression>node.parent;
+            const contextualType = typeChecker.getContextualType(objectLiteral);
+            const name = getNameFromObjectLiteralElement(node);
+            if (name && contextualType) {
+                const result: Symbol[] = [];
+                const symbol = contextualType.getProperty(name);
+                if (symbol) {
+                    result.push(symbol);
+                }
+
+                if (contextualType.flags & TypeFlags.Union) {
+                    forEach((<UnionType>contextualType).types, t => {
+                        const symbol = t.getProperty(name);
+                        if (symbol) {
+                            result.push(symbol);
+                        }
+                    });
+                }
+                return result;
+            }
+            return undefined;
+    }
+
     function isArgumentOfElementAccessExpression(node: Node) {
         return node &&
             node.parent &&
diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts
index 211e55b23ba5e..43e1bfc595b73 100644
--- a/src/services/signatureHelp.ts
+++ b/src/services/signatureHelp.ts
@@ -168,7 +168,8 @@ namespace ts.SignatureHelp {
     export const enum ArgumentListKind {
         TypeArguments,
         CallArguments,
-        TaggedTemplateArguments
+        TaggedTemplateArguments,
+        JSXAttributesArguments
     }
 
     export interface ArgumentListInfo {
@@ -264,18 +265,18 @@ namespace ts.SignatureHelp {
         if (node.parent.kind === SyntaxKind.CallExpression || node.parent.kind === SyntaxKind.NewExpression) {
             const callExpression = <CallExpression>node.parent;
             // There are 3 cases to handle:
-            //   1. The token introduces a list, and should begin a sig help session
+            //   1. The token introduces a list, and should begin a signature help session
             //   2. The token is either not associated with a list, or ends a list, so the session should end
-            //   3. The token is buried inside a list, and should give sig help
+            //   3. The token is buried inside a list, and should give signature help
             //
             // The following are examples of each:
             //
             //    Case 1:
-            //          foo<#T, U>(#a, b)    -> The token introduces a list, and should begin a sig help session
+            //          foo<#T, U>(#a, b)    -> The token introduces a list, and should begin a signature help session
             //    Case 2:
             //          fo#o<T, U>#(a, b)#   -> The token is either not associated with a list, or ends a list, so the session should end
             //    Case 3:
-            //          foo<T#, U#>(a#, #b#) -> The token is buried inside a list, and should give sig help
+            //          foo<T#, U#>(a#, #b#) -> The token is buried inside a list, and should give signature help
             // Find out if 'node' is an argument, a type argument, or neither
             if (node.kind === SyntaxKind.LessThanToken ||
                 node.kind === SyntaxKind.OpenParenToken) {
@@ -295,7 +296,7 @@ namespace ts.SignatureHelp {
 
             // findListItemInfo can return undefined if we are not in parent's argument list
             // or type argument list. This includes cases where the cursor is:
-            //   - To the right of the closing paren, non-substitution template, or template tail.
+            //   - To the right of the closing parenthesize, non-substitution template, or template tail.
             //   - Between the type arguments and the arguments (greater than token)
             //   - On the target of the call (parent.func)
             //   - On the 'new' keyword in a 'new' expression
@@ -352,6 +353,22 @@ namespace ts.SignatureHelp {
 
             return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile);
         }
+        else if (node.parent && isJsxOpeningLikeElement(node.parent)) {
+            // Provide a signature help for JSX opening element or JSX self-closing element.
+            // This is not guarantee that JSX tag-name is resolved into stateless function component. (that is done in "getSignatureHelpItems")
+            // i.e
+            //      export function MainButton(props: ButtonProps, context: any): JSX.Element { ... }
+            //      <MainBuntton /*signatureHelp*/
+            const attributeSpanStart = node.parent.attributes.getFullStart();
+            const attributeSpanEnd = skipTrivia(sourceFile.text, node.parent.attributes.getEnd(), /*stopAfterLineBreak*/ false);
+            return {
+                kind: ArgumentListKind.JSXAttributesArguments,
+                invocation: node.parent,
+                argumentsSpan: createTextSpan(attributeSpanStart, attributeSpanEnd - attributeSpanStart),
+                argumentIndex: 0,
+                argumentCount: 1
+            };
+        }
 
         return undefined;
     }
@@ -392,7 +409,7 @@ namespace ts.SignatureHelp {
         //
         // Note: this subtlety only applies to the last comma.  If you had "Foo(a,,"  then
         // we'll have:  'a' '<comma>' '<missing>'
-        // That will give us 2 non-commas.  We then add one for the last comma, givin us an
+        // That will give us 2 non-commas.  We then add one for the last comma, giving us an
         // arg count of 3.
         const listChildren = argumentsList.getChildren();
 
@@ -435,7 +452,6 @@ namespace ts.SignatureHelp {
             : (<TemplateExpression>tagExpression.template).templateSpans.length + 1;
 
         Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, `argumentCount < argumentIndex, ${argumentCount} < ${argumentIndex}`);
-
         return {
             kind: ArgumentListKind.TaggedTemplateArguments,
             invocation: tagExpression,
diff --git a/src/services/symbolDisplay.ts b/src/services/symbolDisplay.ts
index 516b5d7fbc5b1..97e3b98b908fa 100644
--- a/src/services/symbolDisplay.ts
+++ b/src/services/symbolDisplay.ts
@@ -71,6 +71,9 @@ namespace ts.SymbolDisplay {
                 }
                 return unionPropertyKind;
             }
+            if (location.parent && isJsxAttribute(location.parent)) {
+                return ScriptElementKind.jsxAttribute;
+            }
             return ScriptElementKind.memberVariableElement;
         }
 
@@ -114,23 +117,33 @@ namespace ts.SymbolDisplay {
                 }
 
                 // try get the call/construct signature from the type if it matches
-                let callExpression: CallExpression | NewExpression;
+                let callExpressionLike: CallExpression | NewExpression | JsxOpeningLikeElement;
                 if (location.kind === SyntaxKind.CallExpression || location.kind === SyntaxKind.NewExpression) {
-                    callExpression = <CallExpression | NewExpression>location;
+                    callExpressionLike = <CallExpression | NewExpression>location;
                 }
                 else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) {
-                    callExpression = <CallExpression | NewExpression>location.parent;
+                    callExpressionLike = <CallExpression | NewExpression>location.parent;
+                }
+                else if (location.parent && isJsxOpeningLikeElement(location.parent) && isFunctionLike(symbol.valueDeclaration)) {
+                    callExpressionLike = <JsxOpeningLikeElement>location.parent;
                 }
 
-                if (callExpression) {
+                if (callExpressionLike) {
                     const candidateSignatures: Signature[] = [];
-                    signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures);
+                    signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures);
                     if (!signature && candidateSignatures.length) {
                         // Use the first candidate:
                         signature = candidateSignatures[0];
                     }
 
-                    const useConstructSignatures = callExpression.kind === SyntaxKind.NewExpression || callExpression.expression.kind === SyntaxKind.SuperKeyword;
+                    let useConstructSignatures = false;
+                    if (callExpressionLike.kind === SyntaxKind.NewExpression) {
+                        useConstructSignatures = true;
+                    }
+                    else if (isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === SyntaxKind.SuperKeyword) {
+                        useConstructSignatures = true;
+                    }
+
                     const allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures();
 
                     if (!contains(allSignatures, signature.target) && !contains(allSignatures, signature)) {
@@ -160,6 +173,7 @@ namespace ts.SymbolDisplay {
                         }
 
                         switch (symbolKind) {
+                            case ScriptElementKind.jsxAttribute:
                             case ScriptElementKind.memberVariableElement:
                             case ScriptElementKind.variableElement:
                             case ScriptElementKind.constElement:
@@ -373,6 +387,7 @@ namespace ts.SymbolDisplay {
 
                     // For properties, variables and local vars: show the type
                     if (symbolKind === ScriptElementKind.memberVariableElement ||
+                        symbolKind === ScriptElementKind.jsxAttribute ||
                         symbolFlags & SymbolFlags.Variable ||
                         symbolKind === ScriptElementKind.localVariableElement ||
                         isThisExpression) {
diff --git a/src/services/types.ts b/src/services/types.ts
index 4e04df3fc7caf..b21c974309131 100644
--- a/src/services/types.ts
+++ b/src/services/types.ts
@@ -758,6 +758,11 @@ namespace ts {
         export const directory = "directory";
 
         export const externalModuleName = "external module name";
+
+        /**
+         * <JsxTagName attribute1 attribute2={0} />
+         **/
+        export const jsxAttribute = "JSX attribute";
     }
 
     export namespace ScriptElementKindModifier {
diff --git a/src/services/utilities.ts b/src/services/utilities.ts
index cfb6aae010b63..8c7483889efbd 100644
--- a/src/services/utilities.ts
+++ b/src/services/utilities.ts
@@ -31,6 +31,7 @@ namespace ts {
             case SyntaxKind.FunctionExpression:
             case SyntaxKind.ArrowFunction:
             case SyntaxKind.CatchClause:
+            case SyntaxKind.JsxAttribute:
                 return SemanticMeaning.Value;
 
             case SyntaxKind.TypeParameter:
diff --git a/tests/baselines/reference/callWithSpread.js b/tests/baselines/reference/callWithSpread.js
index 161eb36dbcf73..69f7e4e30b0ac 100644
--- a/tests/baselines/reference/callWithSpread.js
+++ b/tests/baselines/reference/callWithSpread.js
@@ -1,6 +1,6 @@
 //// [callWithSpread.ts]
 interface X {
-    foo(x: number, y: number, ...z: string[]);
+    foo(x: number, y: number, ...z: string[]): X;
 }
 
 function foo(x: number, y: number, ...z: string[]) {
@@ -19,10 +19,18 @@ obj.foo(1, 2, "abc");
 obj.foo(1, 2, ...a);
 obj.foo(1, 2, ...a, "abc");
 
+obj.foo(1, 2, ...a).foo(1, 2, "abc");
+obj.foo(1, 2, ...a).foo(1, 2, ...a);
+obj.foo(1, 2, ...a).foo(1, 2, ...a, "abc");
+
 (obj.foo)(1, 2, "abc");
 (obj.foo)(1, 2, ...a);
 (obj.foo)(1, 2, ...a, "abc");
 
+((obj.foo)(1, 2, ...a).foo)(1, 2, "abc");
+((obj.foo)(1, 2, ...a).foo)(1, 2, ...a);
+((obj.foo)(1, 2, ...a).foo)(1, 2, ...a, "abc");
+
 xa[1].foo(1, 2, "abc");
 xa[1].foo(1, 2, ...a);
 xa[1].foo(1, 2, ...a, "abc");
@@ -72,13 +80,19 @@ foo.apply(void 0, [1, 2].concat(a, ["abc"]));
 obj.foo(1, 2, "abc");
 obj.foo.apply(obj, [1, 2].concat(a));
 obj.foo.apply(obj, [1, 2].concat(a, ["abc"]));
+obj.foo.apply(obj, [1, 2].concat(a)).foo(1, 2, "abc");
+(_a = obj.foo.apply(obj, [1, 2].concat(a))).foo.apply(_a, [1, 2].concat(a));
+(_b = obj.foo.apply(obj, [1, 2].concat(a))).foo.apply(_b, [1, 2].concat(a, ["abc"]));
 (obj.foo)(1, 2, "abc");
 obj.foo.apply(obj, [1, 2].concat(a));
 obj.foo.apply(obj, [1, 2].concat(a, ["abc"]));
+(obj.foo.apply(obj, [1, 2].concat(a)).foo)(1, 2, "abc");
+(_c = obj.foo.apply(obj, [1, 2].concat(a))).foo.apply(_c, [1, 2].concat(a));
+(_d = obj.foo.apply(obj, [1, 2].concat(a))).foo.apply(_d, [1, 2].concat(a, ["abc"]));
 xa[1].foo(1, 2, "abc");
-(_a = xa[1]).foo.apply(_a, [1, 2].concat(a));
-(_b = xa[1]).foo.apply(_b, [1, 2].concat(a, ["abc"]));
-(_c = xa[1]).foo.apply(_c, [1, 2, "abc"]);
+(_e = xa[1]).foo.apply(_e, [1, 2].concat(a));
+(_f = xa[1]).foo.apply(_f, [1, 2].concat(a, ["abc"]));
+(_g = xa[1]).foo.apply(_g, [1, 2, "abc"]);
 var C = (function () {
     function C(x, y) {
         var z = [];
@@ -109,4 +123,4 @@ var D = (function (_super) {
     };
     return D;
 }(C));
-var _a, _b, _c;
+var _a, _b, _c, _d, _e, _f, _g;
diff --git a/tests/baselines/reference/callWithSpread.symbols b/tests/baselines/reference/callWithSpread.symbols
index bc2d9bfebd990..42331422df723 100644
--- a/tests/baselines/reference/callWithSpread.symbols
+++ b/tests/baselines/reference/callWithSpread.symbols
@@ -2,11 +2,12 @@
 interface X {
 >X : Symbol(X, Decl(callWithSpread.ts, 0, 0))
 
-    foo(x: number, y: number, ...z: string[]);
+    foo(x: number, y: number, ...z: string[]): X;
 >foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
 >x : Symbol(x, Decl(callWithSpread.ts, 1, 8))
 >y : Symbol(y, Decl(callWithSpread.ts, 1, 18))
 >z : Symbol(z, Decl(callWithSpread.ts, 1, 29))
+>X : Symbol(X, Decl(callWithSpread.ts, 0, 0))
 }
 
 function foo(x: number, y: number, ...z: string[]) {
@@ -58,6 +59,32 @@ obj.foo(1, 2, ...a, "abc");
 >foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
 >a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
 
+obj.foo(1, 2, ...a).foo(1, 2, "abc");
+>obj.foo(1, 2, ...a).foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3))
+>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
+>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+
+obj.foo(1, 2, ...a).foo(1, 2, ...a);
+>obj.foo(1, 2, ...a).foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3))
+>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
+>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
+
+obj.foo(1, 2, ...a).foo(1, 2, ...a, "abc");
+>obj.foo(1, 2, ...a).foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3))
+>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
+>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
+
 (obj.foo)(1, 2, "abc");
 >obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
 >obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3))
@@ -75,6 +102,32 @@ obj.foo(1, 2, ...a, "abc");
 >foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
 >a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
 
+((obj.foo)(1, 2, ...a).foo)(1, 2, "abc");
+>(obj.foo)(1, 2, ...a).foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3))
+>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
+>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+
+((obj.foo)(1, 2, ...a).foo)(1, 2, ...a);
+>(obj.foo)(1, 2, ...a).foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3))
+>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
+>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
+
+((obj.foo)(1, 2, ...a).foo)(1, 2, ...a, "abc");
+>(obj.foo)(1, 2, ...a).foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3))
+>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
+>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
+>a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
+
 xa[1].foo(1, 2, "abc");
 >xa[1].foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
 >xa : Symbol(xa, Decl(callWithSpread.ts, 10, 3))
@@ -99,60 +152,60 @@ xa[1].foo(1, 2, ...a, "abc");
 >foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
 
 class C {
->C : Symbol(C, Decl(callWithSpread.ts, 28, 40))
+>C : Symbol(C, Decl(callWithSpread.ts, 36, 40))
 
     constructor(x: number, y: number, ...z: string[]) {
->x : Symbol(x, Decl(callWithSpread.ts, 31, 16))
->y : Symbol(y, Decl(callWithSpread.ts, 31, 26))
->z : Symbol(z, Decl(callWithSpread.ts, 31, 37))
+>x : Symbol(x, Decl(callWithSpread.ts, 39, 16))
+>y : Symbol(y, Decl(callWithSpread.ts, 39, 26))
+>z : Symbol(z, Decl(callWithSpread.ts, 39, 37))
 
         this.foo(x, y);
->this.foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5))
->this : Symbol(C, Decl(callWithSpread.ts, 28, 40))
->foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5))
->x : Symbol(x, Decl(callWithSpread.ts, 31, 16))
->y : Symbol(y, Decl(callWithSpread.ts, 31, 26))
+>this.foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
+>this : Symbol(C, Decl(callWithSpread.ts, 36, 40))
+>foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
+>x : Symbol(x, Decl(callWithSpread.ts, 39, 16))
+>y : Symbol(y, Decl(callWithSpread.ts, 39, 26))
 
         this.foo(x, y, ...z);
->this.foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5))
->this : Symbol(C, Decl(callWithSpread.ts, 28, 40))
->foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5))
->x : Symbol(x, Decl(callWithSpread.ts, 31, 16))
->y : Symbol(y, Decl(callWithSpread.ts, 31, 26))
->z : Symbol(z, Decl(callWithSpread.ts, 31, 37))
+>this.foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
+>this : Symbol(C, Decl(callWithSpread.ts, 36, 40))
+>foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
+>x : Symbol(x, Decl(callWithSpread.ts, 39, 16))
+>y : Symbol(y, Decl(callWithSpread.ts, 39, 26))
+>z : Symbol(z, Decl(callWithSpread.ts, 39, 37))
     }
     foo(x: number, y: number, ...z: string[]) {
->foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5))
->x : Symbol(x, Decl(callWithSpread.ts, 35, 8))
->y : Symbol(y, Decl(callWithSpread.ts, 35, 18))
->z : Symbol(z, Decl(callWithSpread.ts, 35, 29))
+>foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
+>x : Symbol(x, Decl(callWithSpread.ts, 43, 8))
+>y : Symbol(y, Decl(callWithSpread.ts, 43, 18))
+>z : Symbol(z, Decl(callWithSpread.ts, 43, 29))
     }
 }
 
 class D extends C {
->D : Symbol(D, Decl(callWithSpread.ts, 37, 1))
->C : Symbol(C, Decl(callWithSpread.ts, 28, 40))
+>D : Symbol(D, Decl(callWithSpread.ts, 45, 1))
+>C : Symbol(C, Decl(callWithSpread.ts, 36, 40))
 
     constructor() {
         super(1, 2);
->super : Symbol(C, Decl(callWithSpread.ts, 28, 40))
+>super : Symbol(C, Decl(callWithSpread.ts, 36, 40))
 
         super(1, 2, ...a);
->super : Symbol(C, Decl(callWithSpread.ts, 28, 40))
+>super : Symbol(C, Decl(callWithSpread.ts, 36, 40))
 >a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
     }
     foo() {
->foo : Symbol(D.foo, Decl(callWithSpread.ts, 43, 5))
+>foo : Symbol(D.foo, Decl(callWithSpread.ts, 51, 5))
 
         super.foo(1, 2);
->super.foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5))
->super : Symbol(C, Decl(callWithSpread.ts, 28, 40))
->foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5))
+>super.foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
+>super : Symbol(C, Decl(callWithSpread.ts, 36, 40))
+>foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
 
         super.foo(1, 2, ...a);
->super.foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5))
->super : Symbol(C, Decl(callWithSpread.ts, 28, 40))
->foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5))
+>super.foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
+>super : Symbol(C, Decl(callWithSpread.ts, 36, 40))
+>foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
 >a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
     }
 }
diff --git a/tests/baselines/reference/callWithSpread.types b/tests/baselines/reference/callWithSpread.types
index c9403f1bb69d4..5af9d2fef846e 100644
--- a/tests/baselines/reference/callWithSpread.types
+++ b/tests/baselines/reference/callWithSpread.types
@@ -2,11 +2,12 @@
 interface X {
 >X : X
 
-    foo(x: number, y: number, ...z: string[]);
->foo : (x: number, y: number, ...z: string[]) => any
+    foo(x: number, y: number, ...z: string[]): X;
+>foo : (x: number, y: number, ...z: string[]) => X
 >x : number
 >y : number
 >z : string[]
+>X : X
 }
 
 function foo(x: number, y: number, ...z: string[]) {
@@ -55,29 +56,80 @@ foo(1, 2, ...a, "abc");
 >"abc" : "abc"
 
 obj.foo(1, 2, "abc");
->obj.foo(1, 2, "abc") : any
->obj.foo : (x: number, y: number, ...z: string[]) => any
+>obj.foo(1, 2, "abc") : X
+>obj.foo : (x: number, y: number, ...z: string[]) => X
 >obj : X
->foo : (x: number, y: number, ...z: string[]) => any
+>foo : (x: number, y: number, ...z: string[]) => X
 >1 : 1
 >2 : 2
 >"abc" : "abc"
 
 obj.foo(1, 2, ...a);
->obj.foo(1, 2, ...a) : any
->obj.foo : (x: number, y: number, ...z: string[]) => any
+>obj.foo(1, 2, ...a) : X
+>obj.foo : (x: number, y: number, ...z: string[]) => X
 >obj : X
->foo : (x: number, y: number, ...z: string[]) => any
+>foo : (x: number, y: number, ...z: string[]) => X
 >1 : 1
 >2 : 2
 >...a : string
 >a : string[]
 
 obj.foo(1, 2, ...a, "abc");
->obj.foo(1, 2, ...a, "abc") : any
->obj.foo : (x: number, y: number, ...z: string[]) => any
+>obj.foo(1, 2, ...a, "abc") : X
+>obj.foo : (x: number, y: number, ...z: string[]) => X
+>obj : X
+>foo : (x: number, y: number, ...z: string[]) => X
+>1 : 1
+>2 : 2
+>...a : string
+>a : string[]
+>"abc" : "abc"
+
+obj.foo(1, 2, ...a).foo(1, 2, "abc");
+>obj.foo(1, 2, ...a).foo(1, 2, "abc") : X
+>obj.foo(1, 2, ...a).foo : (x: number, y: number, ...z: string[]) => X
+>obj.foo(1, 2, ...a) : X
+>obj.foo : (x: number, y: number, ...z: string[]) => X
 >obj : X
->foo : (x: number, y: number, ...z: string[]) => any
+>foo : (x: number, y: number, ...z: string[]) => X
+>1 : 1
+>2 : 2
+>...a : string
+>a : string[]
+>foo : (x: number, y: number, ...z: string[]) => X
+>1 : 1
+>2 : 2
+>"abc" : "abc"
+
+obj.foo(1, 2, ...a).foo(1, 2, ...a);
+>obj.foo(1, 2, ...a).foo(1, 2, ...a) : X
+>obj.foo(1, 2, ...a).foo : (x: number, y: number, ...z: string[]) => X
+>obj.foo(1, 2, ...a) : X
+>obj.foo : (x: number, y: number, ...z: string[]) => X
+>obj : X
+>foo : (x: number, y: number, ...z: string[]) => X
+>1 : 1
+>2 : 2
+>...a : string
+>a : string[]
+>foo : (x: number, y: number, ...z: string[]) => X
+>1 : 1
+>2 : 2
+>...a : string
+>a : string[]
+
+obj.foo(1, 2, ...a).foo(1, 2, ...a, "abc");
+>obj.foo(1, 2, ...a).foo(1, 2, ...a, "abc") : X
+>obj.foo(1, 2, ...a).foo : (x: number, y: number, ...z: string[]) => X
+>obj.foo(1, 2, ...a) : X
+>obj.foo : (x: number, y: number, ...z: string[]) => X
+>obj : X
+>foo : (x: number, y: number, ...z: string[]) => X
+>1 : 1
+>2 : 2
+>...a : string
+>a : string[]
+>foo : (x: number, y: number, ...z: string[]) => X
 >1 : 1
 >2 : 2
 >...a : string
@@ -85,32 +137,89 @@ obj.foo(1, 2, ...a, "abc");
 >"abc" : "abc"
 
 (obj.foo)(1, 2, "abc");
->(obj.foo)(1, 2, "abc") : any
->(obj.foo) : (x: number, y: number, ...z: string[]) => any
->obj.foo : (x: number, y: number, ...z: string[]) => any
+>(obj.foo)(1, 2, "abc") : X
+>(obj.foo) : (x: number, y: number, ...z: string[]) => X
+>obj.foo : (x: number, y: number, ...z: string[]) => X
 >obj : X
->foo : (x: number, y: number, ...z: string[]) => any
+>foo : (x: number, y: number, ...z: string[]) => X
 >1 : 1
 >2 : 2
 >"abc" : "abc"
 
 (obj.foo)(1, 2, ...a);
->(obj.foo)(1, 2, ...a) : any
->(obj.foo) : (x: number, y: number, ...z: string[]) => any
->obj.foo : (x: number, y: number, ...z: string[]) => any
+>(obj.foo)(1, 2, ...a) : X
+>(obj.foo) : (x: number, y: number, ...z: string[]) => X
+>obj.foo : (x: number, y: number, ...z: string[]) => X
 >obj : X
->foo : (x: number, y: number, ...z: string[]) => any
+>foo : (x: number, y: number, ...z: string[]) => X
 >1 : 1
 >2 : 2
 >...a : string
 >a : string[]
 
 (obj.foo)(1, 2, ...a, "abc");
->(obj.foo)(1, 2, ...a, "abc") : any
->(obj.foo) : (x: number, y: number, ...z: string[]) => any
->obj.foo : (x: number, y: number, ...z: string[]) => any
+>(obj.foo)(1, 2, ...a, "abc") : X
+>(obj.foo) : (x: number, y: number, ...z: string[]) => X
+>obj.foo : (x: number, y: number, ...z: string[]) => X
 >obj : X
->foo : (x: number, y: number, ...z: string[]) => any
+>foo : (x: number, y: number, ...z: string[]) => X
+>1 : 1
+>2 : 2
+>...a : string
+>a : string[]
+>"abc" : "abc"
+
+((obj.foo)(1, 2, ...a).foo)(1, 2, "abc");
+>((obj.foo)(1, 2, ...a).foo)(1, 2, "abc") : X
+>((obj.foo)(1, 2, ...a).foo) : (x: number, y: number, ...z: string[]) => X
+>(obj.foo)(1, 2, ...a).foo : (x: number, y: number, ...z: string[]) => X
+>(obj.foo)(1, 2, ...a) : X
+>(obj.foo) : (x: number, y: number, ...z: string[]) => X
+>obj.foo : (x: number, y: number, ...z: string[]) => X
+>obj : X
+>foo : (x: number, y: number, ...z: string[]) => X
+>1 : 1
+>2 : 2
+>...a : string
+>a : string[]
+>foo : (x: number, y: number, ...z: string[]) => X
+>1 : 1
+>2 : 2
+>"abc" : "abc"
+
+((obj.foo)(1, 2, ...a).foo)(1, 2, ...a);
+>((obj.foo)(1, 2, ...a).foo)(1, 2, ...a) : X
+>((obj.foo)(1, 2, ...a).foo) : (x: number, y: number, ...z: string[]) => X
+>(obj.foo)(1, 2, ...a).foo : (x: number, y: number, ...z: string[]) => X
+>(obj.foo)(1, 2, ...a) : X
+>(obj.foo) : (x: number, y: number, ...z: string[]) => X
+>obj.foo : (x: number, y: number, ...z: string[]) => X
+>obj : X
+>foo : (x: number, y: number, ...z: string[]) => X
+>1 : 1
+>2 : 2
+>...a : string
+>a : string[]
+>foo : (x: number, y: number, ...z: string[]) => X
+>1 : 1
+>2 : 2
+>...a : string
+>a : string[]
+
+((obj.foo)(1, 2, ...a).foo)(1, 2, ...a, "abc");
+>((obj.foo)(1, 2, ...a).foo)(1, 2, ...a, "abc") : X
+>((obj.foo)(1, 2, ...a).foo) : (x: number, y: number, ...z: string[]) => X
+>(obj.foo)(1, 2, ...a).foo : (x: number, y: number, ...z: string[]) => X
+>(obj.foo)(1, 2, ...a) : X
+>(obj.foo) : (x: number, y: number, ...z: string[]) => X
+>obj.foo : (x: number, y: number, ...z: string[]) => X
+>obj : X
+>foo : (x: number, y: number, ...z: string[]) => X
+>1 : 1
+>2 : 2
+>...a : string
+>a : string[]
+>foo : (x: number, y: number, ...z: string[]) => X
 >1 : 1
 >2 : 2
 >...a : string
@@ -118,35 +227,35 @@ obj.foo(1, 2, ...a, "abc");
 >"abc" : "abc"
 
 xa[1].foo(1, 2, "abc");
->xa[1].foo(1, 2, "abc") : any
->xa[1].foo : (x: number, y: number, ...z: string[]) => any
+>xa[1].foo(1, 2, "abc") : X
+>xa[1].foo : (x: number, y: number, ...z: string[]) => X
 >xa[1] : X
 >xa : X[]
 >1 : 1
->foo : (x: number, y: number, ...z: string[]) => any
+>foo : (x: number, y: number, ...z: string[]) => X
 >1 : 1
 >2 : 2
 >"abc" : "abc"
 
 xa[1].foo(1, 2, ...a);
->xa[1].foo(1, 2, ...a) : any
->xa[1].foo : (x: number, y: number, ...z: string[]) => any
+>xa[1].foo(1, 2, ...a) : X
+>xa[1].foo : (x: number, y: number, ...z: string[]) => X
 >xa[1] : X
 >xa : X[]
 >1 : 1
->foo : (x: number, y: number, ...z: string[]) => any
+>foo : (x: number, y: number, ...z: string[]) => X
 >1 : 1
 >2 : 2
 >...a : string
 >a : string[]
 
 xa[1].foo(1, 2, ...a, "abc");
->xa[1].foo(1, 2, ...a, "abc") : any
->xa[1].foo : (x: number, y: number, ...z: string[]) => any
+>xa[1].foo(1, 2, ...a, "abc") : X
+>xa[1].foo : (x: number, y: number, ...z: string[]) => X
 >xa[1] : X
 >xa : X[]
 >1 : 1
->foo : (x: number, y: number, ...z: string[]) => any
+>foo : (x: number, y: number, ...z: string[]) => X
 >1 : 1
 >2 : 2
 >...a : string
@@ -158,11 +267,11 @@ xa[1].foo(1, 2, ...a, "abc");
 >(<Function>xa[1].foo) : Function
 ><Function>xa[1].foo : Function
 >Function : Function
->xa[1].foo : (x: number, y: number, ...z: string[]) => any
+>xa[1].foo : (x: number, y: number, ...z: string[]) => X
 >xa[1] : X
 >xa : X[]
 >1 : 1
->foo : (x: number, y: number, ...z: string[]) => any
+>foo : (x: number, y: number, ...z: string[]) => X
 >...[1, 2, "abc"] : string | number
 >[1, 2, "abc"] : (string | number)[]
 >1 : 1
diff --git a/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline b/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline
index a088006d1450e..f8b479e6d7b7b 100644
--- a/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline
+++ b/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline
@@ -1,6 +1,7 @@
 EmitSkipped: true
 Diagnostics:
-  Cannot write file '/tests/cases/fourslash/b.js' because it would overwrite input file.
+ Cannot write file '/tests/cases/fourslash/b.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 
 EmitSkipped: false
 FileName : /tests/cases/fourslash/a.js
diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.errors.txt b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.errors.txt
index 48e11fb12212e..47d0b8c839ada 100644
--- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.errors.txt
+++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.errors.txt
@@ -1,5 +1,9 @@
-tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx(16,15): error TS2322: Type '"f"' is not assignable to type '"A" | "B" | "C"'.
-tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx(17,15): error TS2322: Type '"f"' is not assignable to type '"A" | "B" | "C"'.
+tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx(16,15): error TS2322: Type '{ foo: "f"; }' is not assignable to type '{ foo: "A" | "B" | "C"; }'.
+  Types of property 'foo' are incompatible.
+    Type '"f"' is not assignable to type '"A" | "B" | "C"'.
+tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx(17,15): error TS2322: Type '{ foo: "f"; }' is not assignable to type '{ foo: "A" | "B" | "C"; }'.
+  Types of property 'foo' are incompatible.
+    Type '"f"' is not assignable to type '"A" | "B" | "C"'.
 
 
 ==== tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx (2 errors) ====
@@ -20,7 +24,11 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStr
     
     <FooComponent foo={"f"} />;
                   ~~~~~~~~~
-!!! error TS2322: Type '"f"' is not assignable to type '"A" | "B" | "C"'.
+!!! error TS2322: Type '{ foo: "f"; }' is not assignable to type '{ foo: "A" | "B" | "C"; }'.
+!!! error TS2322:   Types of property 'foo' are incompatible.
+!!! error TS2322:     Type '"f"' is not assignable to type '"A" | "B" | "C"'.
     <FooComponent foo="f"   />;
                   ~~~~~~~
-!!! error TS2322: Type '"f"' is not assignable to type '"A" | "B" | "C"'.
\ No newline at end of file
+!!! error TS2322: Type '{ foo: "f"; }' is not assignable to type '{ foo: "A" | "B" | "C"; }'.
+!!! error TS2322:   Types of property 'foo' are incompatible.
+!!! error TS2322:     Type '"f"' is not assignable to type '"A" | "B" | "C"'.
\ No newline at end of file
diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt
new file mode 100644
index 0000000000000..9b6371a1df8be
--- /dev/null
+++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt
@@ -0,0 +1,71 @@
+tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,24): error TS2322: Type '{ extra: true; onClick: (k: any) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
+  Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
+tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,24): error TS2322: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
+  Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'.
+tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,24): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
+  Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
+tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(31,24): error TS2322: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
+  Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
+tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(34,25): error TS2322: Type '{ extra: true; onClick: (k: any) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
+  Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
+tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(37,25): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
+  Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
+
+
+==== tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx (6 errors) ====
+    
+    import React = require('react')
+    
+    export interface ClickableProps {
+        children?: string;
+        className?: string;
+    }
+    
+    export interface ButtonProps extends ClickableProps {
+        onClick: (k: "left" | "right") => void;
+    }
+    
+    export interface LinkProps extends ClickableProps {
+        goTo: "home" | "contact";
+    }
+    
+    export function MainButton(buttonProps: ButtonProps): JSX.Element;
+    export function MainButton(linkProps: LinkProps): JSX.Element;
+    export function MainButton(props: ButtonProps | LinkProps): JSX.Element {
+        const linkProps = props as LinkProps;
+        if(linkProps.goTo) {
+            return this._buildMainLink(props);
+        }
+    
+        return this._buildMainButton(props);
+    }
+    
+    const b0 = <MainButton {...{onClick: (k) => {console.log(k)}}} extra />;  // k has type any
+                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ extra: true; onClick: (k: any) => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
+!!! error TS2322:   Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
+    const b2 = <MainButton onClick={(k)=>{console.log(k)}} extra />;  // k has type "left" | "right"
+                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
+!!! error TS2322:   Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'.
+    const b3 = <MainButton {...{goTo:"home"}} extra />;  // goTo has type"home" | "contact"
+                           ~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
+!!! error TS2322:   Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
+    const b4 = <MainButton goTo="home" extra />;  // goTo has type "home" | "contact"
+                           ~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
+!!! error TS2322:   Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
+    
+    export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined }
+    const c1 = <NoOverload  {...{onClick: (k) => {console.log(k)}}} extra />;  // k has type any
+                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ extra: true; onClick: (k: any) => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
+!!! error TS2322:   Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
+    
+    export function NoOverload1(linkProps: LinkProps): JSX.Element { return undefined }
+    const d1 = <NoOverload1 {...{goTo:"home"}} extra  />;  // goTo has type "home" | "contact"
+                            ~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
+!!! error TS2322:   Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
+    
\ No newline at end of file
diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.js b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.js
new file mode 100644
index 0000000000000..9c7f01960677a
--- /dev/null
+++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.js
@@ -0,0 +1,62 @@
+//// [file.tsx]
+
+import React = require('react')
+
+export interface ClickableProps {
+    children?: string;
+    className?: string;
+}
+
+export interface ButtonProps extends ClickableProps {
+    onClick: (k: "left" | "right") => void;
+}
+
+export interface LinkProps extends ClickableProps {
+    goTo: "home" | "contact";
+}
+
+export function MainButton(buttonProps: ButtonProps): JSX.Element;
+export function MainButton(linkProps: LinkProps): JSX.Element;
+export function MainButton(props: ButtonProps | LinkProps): JSX.Element {
+    const linkProps = props as LinkProps;
+    if(linkProps.goTo) {
+        return this._buildMainLink(props);
+    }
+
+    return this._buildMainButton(props);
+}
+
+const b0 = <MainButton {...{onClick: (k) => {console.log(k)}}} extra />;  // k has type any
+const b2 = <MainButton onClick={(k)=>{console.log(k)}} extra />;  // k has type "left" | "right"
+const b3 = <MainButton {...{goTo:"home"}} extra />;  // goTo has type"home" | "contact"
+const b4 = <MainButton goTo="home" extra />;  // goTo has type "home" | "contact"
+
+export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined }
+const c1 = <NoOverload  {...{onClick: (k) => {console.log(k)}}} extra />;  // k has type any
+
+export function NoOverload1(linkProps: LinkProps): JSX.Element { return undefined }
+const d1 = <NoOverload1 {...{goTo:"home"}} extra  />;  // goTo has type "home" | "contact"
+
+
+//// [file.jsx]
+define(["require", "exports", "react"], function (require, exports, React) {
+    "use strict";
+    function MainButton(props) {
+        var linkProps = props;
+        if (linkProps.goTo) {
+            return this._buildMainLink(props);
+        }
+        return this._buildMainButton(props);
+    }
+    exports.MainButton = MainButton;
+    var b0 = <MainButton {...{ onClick: function (k) { console.log(k); } }} extra/>; // k has type any
+    var b2 = <MainButton onClick={function (k) { console.log(k); }} extra/>; // k has type "left" | "right"
+    var b3 = <MainButton {...{ goTo: "home" }} extra/>; // goTo has type"home" | "contact"
+    var b4 = <MainButton goTo="home" extra/>; // goTo has type "home" | "contact"
+    function NoOverload(buttonProps) { return undefined; }
+    exports.NoOverload = NoOverload;
+    var c1 = <NoOverload {...{ onClick: function (k) { console.log(k); } }} extra/>; // k has type any
+    function NoOverload1(linkProps) { return undefined; }
+    exports.NoOverload1 = NoOverload1;
+    var d1 = <NoOverload1 {...{ goTo: "home" }} extra/>; // goTo has type "home" | "contact"
+});
diff --git a/tests/baselines/reference/declarationFileOverwriteError.errors.txt b/tests/baselines/reference/declarationFileOverwriteError.errors.txt
index 1974976dee1fe..211469778b1fe 100644
--- a/tests/baselines/reference/declarationFileOverwriteError.errors.txt
+++ b/tests/baselines/reference/declarationFileOverwriteError.errors.txt
@@ -1,7 +1,9 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.d.ts (0 errors) ====
     
     declare class c {
diff --git a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt
index 658465de9c2d2..ea4a93b3b12db 100644
--- a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt
+++ b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt
@@ -1,7 +1,9 @@
 error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/out.d.ts (0 errors) ====
     
     declare class c {
diff --git a/tests/baselines/reference/exportDefaultInJsFile01.errors.txt b/tests/baselines/reference/exportDefaultInJsFile01.errors.txt
index 34035e1e14e73..0565c8bd61ef2 100644
--- a/tests/baselines/reference/exportDefaultInJsFile01.errors.txt
+++ b/tests/baselines/reference/exportDefaultInJsFile01.errors.txt
@@ -1,7 +1,9 @@
 error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile01.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 
 
 !!! error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile01.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/conformance/salsa/myFile01.js (0 errors) ====
     
     export default "hello";
\ No newline at end of file
diff --git a/tests/baselines/reference/exportDefaultInJsFile02.errors.txt b/tests/baselines/reference/exportDefaultInJsFile02.errors.txt
index 5e17306e066f5..a74fbacfcfd87 100644
--- a/tests/baselines/reference/exportDefaultInJsFile02.errors.txt
+++ b/tests/baselines/reference/exportDefaultInJsFile02.errors.txt
@@ -1,7 +1,9 @@
 error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile02.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 
 
 !!! error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile02.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/conformance/salsa/myFile02.js (0 errors) ====
     
     export default "hello";
\ No newline at end of file
diff --git a/tests/baselines/reference/jsFileCompilationAmbientVarDeclarationSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationAmbientVarDeclarationSyntax.errors.txt
index 19bfd5d1c0205..039834ff702af 100644
--- a/tests/baselines/reference/jsFileCompilationAmbientVarDeclarationSyntax.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationAmbientVarDeclarationSyntax.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,1): error TS8009: 'declare' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     declare var v;
     ~~~~~~~
diff --git a/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.errors.txt b/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.errors.txt
index 0aa9d5733d532..75bcf88b10a13 100644
--- a/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 !!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files.
 ==== tests/cases/compiler/a.ts (0 errors) ====
     class c {
diff --git a/tests/baselines/reference/jsFileCompilationEnumSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationEnumSyntax.errors.txt
index 538dfb38972bc..c6da8931d5e3e 100644
--- a/tests/baselines/reference/jsFileCompilationEnumSyntax.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationEnumSyntax.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,6): error TS8015: 'enum declarations' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     enum E { }
          ~
diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt
index 641731936f84a..54e91c5d1961e 100644
--- a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt
@@ -1,9 +1,11 @@
 error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
 error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 
 
 !!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
 !!! error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.ts (0 errors) ====
     class c {
     }
diff --git a/tests/baselines/reference/jsFileCompilationExportAssignmentSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationExportAssignmentSyntax.errors.txt
index f537941c55cf1..babbeea800455 100644
--- a/tests/baselines/reference/jsFileCompilationExportAssignmentSyntax.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationExportAssignmentSyntax.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,1): error TS8003: 'export=' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     export = b;
     ~~~~~~~~~~~
diff --git a/tests/baselines/reference/jsFileCompilationHeritageClauseSyntaxOfClass.errors.txt b/tests/baselines/reference/jsFileCompilationHeritageClauseSyntaxOfClass.errors.txt
index 33b8a45f1aab0..3b30663308fa5 100644
--- a/tests/baselines/reference/jsFileCompilationHeritageClauseSyntaxOfClass.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationHeritageClauseSyntaxOfClass.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,9): error TS8005: 'implements clauses' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     class C implements D { }
             ~~~~~~~~~~~~
diff --git a/tests/baselines/reference/jsFileCompilationImportEqualsSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationImportEqualsSyntax.errors.txt
index b416136703755..a064f53e92fa4 100644
--- a/tests/baselines/reference/jsFileCompilationImportEqualsSyntax.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationImportEqualsSyntax.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,1): error TS8002: 'import ... =' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     import a = b;
     ~~~~~~~~~~~~~
diff --git a/tests/baselines/reference/jsFileCompilationInterfaceSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationInterfaceSyntax.errors.txt
index 17fb8fcb18741..9e53438c732fd 100644
--- a/tests/baselines/reference/jsFileCompilationInterfaceSyntax.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationInterfaceSyntax.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,11): error TS8006: 'interface declarations' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     interface I { }
               ~
diff --git a/tests/baselines/reference/jsFileCompilationModuleSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationModuleSyntax.errors.txt
index 662028c53ed93..6952c0055c0ee 100644
--- a/tests/baselines/reference/jsFileCompilationModuleSyntax.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationModuleSyntax.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,8): error TS8007: 'module declarations' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     module M { }
            ~
diff --git a/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.errors.txt b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.errors.txt
index f2f4142b99380..888310414f275 100644
--- a/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.errors.txt
@@ -1,7 +1,9 @@
 error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.ts (0 errors) ====
     class c {
     }
diff --git a/tests/baselines/reference/jsFileCompilationOptionalParameter.errors.txt b/tests/baselines/reference/jsFileCompilationOptionalParameter.errors.txt
index 295f827dd2d7c..15bfe2281d96f 100644
--- a/tests/baselines/reference/jsFileCompilationOptionalParameter.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationOptionalParameter.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,13): error TS8009: '?' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     function F(p?) { }
                 ~
diff --git a/tests/baselines/reference/jsFileCompilationPublicMethodSyntaxOfClass.errors.txt b/tests/baselines/reference/jsFileCompilationPublicMethodSyntaxOfClass.errors.txt
index d67c9baea70e5..af95c13620559 100644
--- a/tests/baselines/reference/jsFileCompilationPublicMethodSyntaxOfClass.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationPublicMethodSyntaxOfClass.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(2,5): error TS8009: 'public' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     class C {
         public foo() {
diff --git a/tests/baselines/reference/jsFileCompilationPublicParameterModifier.errors.txt b/tests/baselines/reference/jsFileCompilationPublicParameterModifier.errors.txt
index bc4913f6217b4..9314e1da807aa 100644
--- a/tests/baselines/reference/jsFileCompilationPublicParameterModifier.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationPublicParameterModifier.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,23): error TS8012: 'parameter modifiers' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     class C { constructor(public x) { }}
                           ~~~~~~
diff --git a/tests/baselines/reference/jsFileCompilationReturnTypeSyntaxOfFunction.errors.txt b/tests/baselines/reference/jsFileCompilationReturnTypeSyntaxOfFunction.errors.txt
index 6dad5a294854c..acae950d0816a 100644
--- a/tests/baselines/reference/jsFileCompilationReturnTypeSyntaxOfFunction.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationReturnTypeSyntaxOfFunction.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,15): error TS8010: 'types' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     function F(): number { }
                   ~~~~~~
diff --git a/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt b/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt
index d98a1e7e7bbc8..eb4c114d3d074 100644
--- a/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt
@@ -1,7 +1,9 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (0 errors) ====
     /**
       * @type {number}
diff --git a/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt
index 2b5112e1ce2ed..74978eddf8ce1 100644
--- a/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,6): error TS8008: 'type aliases' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     type a = b;
          ~
diff --git a/tests/baselines/reference/jsFileCompilationTypeArgumentSyntaxOfCall.errors.txt b/tests/baselines/reference/jsFileCompilationTypeArgumentSyntaxOfCall.errors.txt
index 8ac59196ed960..f53ec55d2b1e0 100644
--- a/tests/baselines/reference/jsFileCompilationTypeArgumentSyntaxOfCall.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationTypeArgumentSyntaxOfCall.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,5): error TS8011: 'type arguments' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     Foo<number>();
         ~~~~~~
diff --git a/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt b/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt
index 662eea4d4050c..be1e6d3243699 100644
--- a/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt
@@ -1,9 +1,11 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,10): error TS17008: JSX element 'string' has no corresponding closing tag.
 tests/cases/compiler/a.js(1,27): error TS1005: '</' expected.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (2 errors) ====
     var v = <string>undefined;
              ~~~~~~
diff --git a/tests/baselines/reference/jsFileCompilationTypeOfParameter.errors.txt b/tests/baselines/reference/jsFileCompilationTypeOfParameter.errors.txt
index 680b32a64f1ad..811c0793ffe15 100644
--- a/tests/baselines/reference/jsFileCompilationTypeOfParameter.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationTypeOfParameter.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,15): error TS8010: 'types' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     function F(a: number) { }
                   ~~~~~~
diff --git a/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfClass.errors.txt b/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfClass.errors.txt
index 161c832ffd5d4..0fe902aa661cb 100644
--- a/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfClass.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfClass.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,9): error TS8004: 'type parameter declarations' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     class C<T> { }
             ~
diff --git a/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfFunction.errors.txt b/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfFunction.errors.txt
index d7626f68564cf..bfc4c7be26a4d 100644
--- a/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfFunction.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfFunction.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,12): error TS8004: 'type parameter declarations' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     function F<T>() { }
                ~
diff --git a/tests/baselines/reference/jsFileCompilationTypeSyntaxOfVar.errors.txt b/tests/baselines/reference/jsFileCompilationTypeSyntaxOfVar.errors.txt
index 2c6ac3771bef8..653337517800b 100644
--- a/tests/baselines/reference/jsFileCompilationTypeSyntaxOfVar.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationTypeSyntaxOfVar.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 tests/cases/compiler/a.js(1,8): error TS8010: 'types' can only be used in a .ts file.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.js (1 errors) ====
     var v: () => number;
            ~~~~~~~~~~~~
diff --git a/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt b/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt
index 9e9c2adb0efa2..4170e818fd76b 100644
--- a/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt
@@ -1,7 +1,9 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.ts (0 errors) ====
     class c {
     }
diff --git a/tests/baselines/reference/jsFileCompilationWithJsEmitPathSameAsInput.errors.txt b/tests/baselines/reference/jsFileCompilationWithJsEmitPathSameAsInput.errors.txt
index 4cc2cc2ab4547..8004efd02eff4 100644
--- a/tests/baselines/reference/jsFileCompilationWithJsEmitPathSameAsInput.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationWithJsEmitPathSameAsInput.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 !!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files.
 ==== tests/cases/compiler/a.ts (0 errors) ====
     class c {
diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.errors.txt b/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.errors.txt
index 06186b9f0b2fc..069c562f29bf8 100644
--- a/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 !!! error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'.
 ==== tests/cases/compiler/a.ts (0 errors) ====
     
diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.errors.txt b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.errors.txt
index 06186b9f0b2fc..069c562f29bf8 100644
--- a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.errors.txt
@@ -1,8 +1,10 @@
 error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'.
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 !!! error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'.
 ==== tests/cases/compiler/a.ts (0 errors) ====
     
diff --git a/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt
index 10c7b8c90ddad..0a4f0cdf1a45b 100644
--- a/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt
@@ -1,7 +1,9 @@
 error TS5055: Cannot write file 'tests/cases/compiler/b.d.ts' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/b.d.ts' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.ts (0 errors) ====
     class c {
     }
diff --git a/tests/baselines/reference/jsFileCompilationWithOutFileNameSameAsInputJsFile.errors.txt b/tests/baselines/reference/jsFileCompilationWithOutFileNameSameAsInputJsFile.errors.txt
index 0f6852b21a0a2..3f72a8113ef2c 100644
--- a/tests/baselines/reference/jsFileCompilationWithOutFileNameSameAsInputJsFile.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationWithOutFileNameSameAsInputJsFile.errors.txt
@@ -1,7 +1,9 @@
 error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.ts (0 errors) ====
     class c {
     }
diff --git a/tests/baselines/reference/jsFileCompilationWithoutOut.errors.txt b/tests/baselines/reference/jsFileCompilationWithoutOut.errors.txt
index 0f6852b21a0a2..3f72a8113ef2c 100644
--- a/tests/baselines/reference/jsFileCompilationWithoutOut.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationWithoutOut.errors.txt
@@ -1,7 +1,9 @@
 error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 
 
 !!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== tests/cases/compiler/a.ts (0 errors) ====
     class c {
     }
diff --git a/tests/baselines/reference/jsxEmitAttributeWithPreserve.symbols b/tests/baselines/reference/jsxEmitAttributeWithPreserve.symbols
index 82eceb8e63790..a5f910776b0d7 100644
--- a/tests/baselines/reference/jsxEmitAttributeWithPreserve.symbols
+++ b/tests/baselines/reference/jsxEmitAttributeWithPreserve.symbols
@@ -5,5 +5,5 @@ declare var React: any;
 
 <foo data/>
 >foo : Symbol(unknown)
->data : Symbol(unknown)
+>data : Symbol(data, Decl(jsxEmitAttributeWithPreserve.tsx, 2, 4))
 
diff --git a/tests/baselines/reference/jsxEmitAttributeWithPreserve.types b/tests/baselines/reference/jsxEmitAttributeWithPreserve.types
index 972ca1c3d88ad..7d218f422bf06 100644
--- a/tests/baselines/reference/jsxEmitAttributeWithPreserve.types
+++ b/tests/baselines/reference/jsxEmitAttributeWithPreserve.types
@@ -6,5 +6,5 @@ declare var React: any;
 <foo data/>
 ><foo data/> : any
 >foo : any
->data : any
+>data : true
 
diff --git a/tests/baselines/reference/jsxEmitWithAttributes.symbols b/tests/baselines/reference/jsxEmitWithAttributes.symbols
index 16cd35d1ca323..f2579903d3e7d 100644
--- a/tests/baselines/reference/jsxEmitWithAttributes.symbols
+++ b/tests/baselines/reference/jsxEmitWithAttributes.symbols
@@ -101,12 +101,12 @@ class A {
 		return [
 			<meta content="helloworld"></meta>,
 >meta : Symbol(unknown)
->content : Symbol(unknown)
+>content : Symbol(content, Decl(test.tsx, 11, 8))
 >meta : Symbol(unknown)
 
 			<meta content={c.a!.b}></meta>
 >meta : Symbol(unknown)
->content : Symbol(unknown)
+>content : Symbol(content, Decl(test.tsx, 12, 8))
 >c.a!.b : Symbol(b, Decl(test.tsx, 3, 6))
 >c.a : Symbol(a, Decl(test.tsx, 2, 8))
 >c : Symbol(c, Decl(test.tsx, 2, 3))
diff --git a/tests/baselines/reference/jsxEmitWithAttributes.types b/tests/baselines/reference/jsxEmitWithAttributes.types
index 663ba4b5bfc43..724aed319ec03 100644
--- a/tests/baselines/reference/jsxEmitWithAttributes.types
+++ b/tests/baselines/reference/jsxEmitWithAttributes.types
@@ -114,13 +114,13 @@ class A {
 			<meta content="helloworld"></meta>,
 ><meta content="helloworld"></meta> : any
 >meta : any
->content : any
+>content : string
 >meta : any
 
 			<meta content={c.a!.b}></meta>
 ><meta content={c.a!.b}></meta> : any
 >meta : any
->content : any
+>content : string
 >c.a!.b : string
 >c.a! : { b: string; }
 >c.a : { b: string; }
diff --git a/tests/baselines/reference/jsxImportInAttribute.symbols b/tests/baselines/reference/jsxImportInAttribute.symbols
index 252b5cc98e42a..daf4dd110a344 100644
--- a/tests/baselines/reference/jsxImportInAttribute.symbols
+++ b/tests/baselines/reference/jsxImportInAttribute.symbols
@@ -9,7 +9,7 @@ let x = Test; // emit test_1.default
 
 <anything attr={Test} />; // ?
 >anything : Symbol(unknown)
->attr : Symbol(unknown)
+>attr : Symbol(attr, Decl(consumer.tsx, 4, 9))
 >Test : Symbol(Test, Decl(consumer.tsx, 1, 6))
 
 === tests/cases/compiler/component.d.ts ===
diff --git a/tests/baselines/reference/jsxImportInAttribute.types b/tests/baselines/reference/jsxImportInAttribute.types
index 8dc5c370fa84d..b4317f508c2b8 100644
--- a/tests/baselines/reference/jsxImportInAttribute.types
+++ b/tests/baselines/reference/jsxImportInAttribute.types
@@ -10,7 +10,7 @@ let x = Test; // emit test_1.default
 <anything attr={Test} />; // ?
 ><anything attr={Test} /> : any
 >anything : any
->attr : any
+>attr : typeof Test
 >Test : typeof Test
 
 === tests/cases/compiler/component.d.ts ===
diff --git a/tests/baselines/reference/jsxReactTestSuite.symbols b/tests/baselines/reference/jsxReactTestSuite.symbols
index 956b4cff6f7b3..36c0eef93a889 100644
--- a/tests/baselines/reference/jsxReactTestSuite.symbols
+++ b/tests/baselines/reference/jsxReactTestSuite.symbols
@@ -92,26 +92,26 @@ var x =
 >div : Symbol(unknown)
 
     attr1={
->attr1 : Symbol(unknown)
+>attr1 : Symbol(attr1, Decl(jsxReactTestSuite.tsx, 36, 6))
 
       "foo" + "bar"
     }
     attr2={
->attr2 : Symbol(unknown)
+>attr2 : Symbol(attr2, Decl(jsxReactTestSuite.tsx, 39, 5))
 
       "foo" + "bar" +
       
       "baz" + "bug"
     }
     attr3={
->attr3 : Symbol(unknown)
+>attr3 : Symbol(attr3, Decl(jsxReactTestSuite.tsx, 44, 5))
 
       "foo" + "bar" +
       "baz" + "bug"
       // Extra line here.
     }
     attr4="baz">
->attr4 : Symbol(unknown)
+>attr4 : Symbol(attr4, Decl(jsxReactTestSuite.tsx, 49, 5))
 
   </div>;
 >div : Symbol(unknown)
@@ -147,13 +147,13 @@ var x =
     /* a multi-line
        comment */
     attr1="foo">
->attr1 : Symbol(unknown)
+>attr1 : Symbol(attr1, Decl(jsxReactTestSuite.tsx, 68, 6))
 
     <span // a double-slash comment
 >span : Symbol(unknown)
 
       attr2="bar"
->attr2 : Symbol(unknown)
+>attr2 : Symbol(attr2, Decl(jsxReactTestSuite.tsx, 72, 9))
 
     />
   </div>
@@ -175,7 +175,7 @@ var x =
 
 <Component constructor="foo" />;
 >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
->constructor : Symbol(unknown)
+>constructor : Symbol(constructor, Decl(jsxReactTestSuite.tsx, 84, 10))
 
 <Namespace.Component />;
 >Namespace : Symbol(Namespace, Decl(jsxReactTestSuite.tsx, 6, 11))
@@ -186,23 +186,23 @@ var x =
 <Component { ... x } y
 >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
 >x : Symbol(x, Decl(jsxReactTestSuite.tsx, 10, 11), Decl(jsxReactTestSuite.tsx, 35, 3))
->y : Symbol(unknown)
+>y : Symbol(y, Decl(jsxReactTestSuite.tsx, 90, 20))
 
 ={2 } z />;
->z : Symbol(unknown)
+>z : Symbol(z, Decl(jsxReactTestSuite.tsx, 91, 5))
 
 <Component
 >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
 
     {...this.props} sound="moo" />;
->sound : Symbol(unknown)
+>sound : Symbol(sound, Decl(jsxReactTestSuite.tsx, 94, 19))
 
 <font-face />;
 >font-face : Symbol(unknown)
 
 <Component x={y} />;
 >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
->x : Symbol(unknown)
+>x : Symbol(x, Decl(jsxReactTestSuite.tsx, 98, 10))
 >y : Symbol(y, Decl(jsxReactTestSuite.tsx, 9, 11))
 
 <x-component />;
@@ -215,24 +215,24 @@ var x =
 <Component { ...x } y={2} />;
 >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
 >x : Symbol(x, Decl(jsxReactTestSuite.tsx, 10, 11), Decl(jsxReactTestSuite.tsx, 35, 3))
->y : Symbol(unknown)
+>y : Symbol(y, Decl(jsxReactTestSuite.tsx, 104, 19))
 
 <Component { ... x } y={2} z />;
 >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
 >x : Symbol(x, Decl(jsxReactTestSuite.tsx, 10, 11), Decl(jsxReactTestSuite.tsx, 35, 3))
->y : Symbol(unknown)
->z : Symbol(unknown)
+>y : Symbol(y, Decl(jsxReactTestSuite.tsx, 106, 20))
+>z : Symbol(z, Decl(jsxReactTestSuite.tsx, 106, 26))
 
 <Component x={1} {...y} />;
 >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
->x : Symbol(unknown)
+>x : Symbol(x, Decl(jsxReactTestSuite.tsx, 108, 10))
 >y : Symbol(y, Decl(jsxReactTestSuite.tsx, 9, 11))
 
 
 <Component x={1} y="2" {...z} {...z}><Child /></Component>;
 >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
->x : Symbol(unknown)
->y : Symbol(unknown)
+>x : Symbol(x, Decl(jsxReactTestSuite.tsx, 111, 10))
+>y : Symbol(y, Decl(jsxReactTestSuite.tsx, 111, 16))
 >z : Symbol(z, Decl(jsxReactTestSuite.tsx, 11, 11))
 >z : Symbol(z, Decl(jsxReactTestSuite.tsx, 11, 11))
 >Child : Symbol(Child, Decl(jsxReactTestSuite.tsx, 5, 11))
@@ -240,11 +240,11 @@ var x =
 
 <Component x="1" {...(z = { y: 2 }, z)} z={3}>Text</Component>;
 >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
->x : Symbol(unknown)
+>x : Symbol(x, Decl(jsxReactTestSuite.tsx, 113, 10))
 >z : Symbol(z, Decl(jsxReactTestSuite.tsx, 11, 11))
 >y : Symbol(y, Decl(jsxReactTestSuite.tsx, 113, 27))
 >z : Symbol(z, Decl(jsxReactTestSuite.tsx, 11, 11))
->z : Symbol(unknown)
+>z : Symbol(z, Decl(jsxReactTestSuite.tsx, 113, 39))
 >Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
 
 
diff --git a/tests/baselines/reference/jsxReactTestSuite.types b/tests/baselines/reference/jsxReactTestSuite.types
index 712a7368a622f..bd120ba9df232 100644
--- a/tests/baselines/reference/jsxReactTestSuite.types
+++ b/tests/baselines/reference/jsxReactTestSuite.types
@@ -116,7 +116,7 @@ var x =
 >div : any
 
     attr1={
->attr1 : any
+>attr1 : string
 
       "foo" + "bar"
 >"foo" + "bar" : string
@@ -124,7 +124,7 @@ var x =
 >"bar" : "bar"
     }
     attr2={
->attr2 : any
+>attr2 : string
 
       "foo" + "bar" +
 >"foo" + "bar" +            "baz" + "bug" : string
@@ -138,7 +138,7 @@ var x =
 >"bug" : "bug"
     }
     attr3={
->attr3 : any
+>attr3 : string
 
       "foo" + "bar" +
 >"foo" + "bar" +      "baz" + "bug" : string
@@ -154,7 +154,7 @@ var x =
       // Extra line here.
     }
     attr4="baz">
->attr4 : any
+>attr4 : string
 
   </div>;
 >div : any
@@ -198,14 +198,14 @@ var x =
     /* a multi-line
        comment */
     attr1="foo">
->attr1 : any
+>attr1 : string
 
     <span // a double-slash comment
 ><span // a double-slash comment      attr2="bar"    /> : any
 >span : any
 
       attr2="bar"
->attr2 : any
+>attr2 : string
 
     />
   </div>
@@ -231,7 +231,7 @@ var x =
 <Component constructor="foo" />;
 ><Component constructor="foo" /> : any
 >Component : any
->constructor : any
+>constructor : string
 
 <Namespace.Component />;
 ><Namespace.Component /> : any
@@ -251,11 +251,11 @@ var x =
 ><Component { ... x } y={2 } z /> : any
 >Component : any
 >x : any
->y : any
+>y : number
 
 ={2 } z />;
 >2 : 2
->z : any
+>z : true
 
 <Component
 ><Component    {...this.props} sound="moo" /> : any
@@ -265,7 +265,7 @@ var x =
 >this.props : any
 >this : any
 >props : any
->sound : any
+>sound : string
 
 <font-face />;
 ><font-face /> : any
@@ -290,21 +290,21 @@ var x =
 ><Component { ...x } y={2} /> : any
 >Component : any
 >x : any
->y : any
+>y : number
 >2 : 2
 
 <Component { ... x } y={2} z />;
 ><Component { ... x } y={2} z /> : any
 >Component : any
 >x : any
->y : any
+>y : number
 >2 : 2
->z : any
+>z : true
 
 <Component x={1} {...y} />;
 ><Component x={1} {...y} /> : any
 >Component : any
->x : any
+>x : number
 >1 : 1
 >y : any
 
@@ -312,9 +312,9 @@ var x =
 <Component x={1} y="2" {...z} {...z}><Child /></Component>;
 ><Component x={1} y="2" {...z} {...z}><Child /></Component> : any
 >Component : any
->x : any
+>x : number
 >1 : 1
->y : any
+>y : string
 >z : any
 >z : any
 ><Child /> : any
@@ -324,7 +324,7 @@ var x =
 <Component x="1" {...(z = { y: 2 }, z)} z={3}>Text</Component>;
 ><Component x="1" {...(z = { y: 2 }, z)} z={3}>Text</Component> : any
 >Component : any
->x : any
+>x : string
 >(z = { y: 2 }, z) : any
 >z = { y: 2 }, z : any
 >z = { y: 2 } : { y: number; }
@@ -333,7 +333,7 @@ var x =
 >y : number
 >2 : 2
 >z : any
->z : any
+>z : number
 >3 : 3
 >Component : any
 
diff --git a/tests/baselines/reference/keyofAndIndexedAccess.js b/tests/baselines/reference/keyofAndIndexedAccess.js
index 5d986f3e89203..dd59a5a1b4c72 100644
--- a/tests/baselines/reference/keyofAndIndexedAccess.js
+++ b/tests/baselines/reference/keyofAndIndexedAccess.js
@@ -7,6 +7,10 @@ class Shape {
     visible: boolean;
 }
 
+class TaggedShape extends Shape {
+    tag: string;
+}
+
 class Item {
     name: string;
     price: number;
@@ -149,6 +153,17 @@ function f32<K extends "width" | "height">(key: K) {
     return shape[key];  // Shape[K]
 }
 
+function f33<S extends Shape, K extends keyof S>(shape: S, key: K) {
+    let name = getProperty(shape, "name");
+    let prop = getProperty(shape, key);
+    return prop;
+}
+
+function f34(ts: TaggedShape) {
+    let tag1 = f33(ts, "tag");
+    let tag2 = getProperty(ts, "tag");
+}
+
 class C {
     public x: string;
     protected y: string;
@@ -164,14 +179,58 @@ function f40(c: C) {
     let x: X = c["x"];
     let y: Y = c["y"];
     let z: Z = c["z"];
+}
+
+// Repros from #12011
+
+class Base {
+    get<K extends keyof this>(prop: K) {
+        return this[prop];
+    }
+    set<K extends keyof this>(prop: K, value: this[K]) {
+        this[prop] = value;
+    }
+}
+
+class Person extends Base {
+    parts: number;
+    constructor(parts: number) {
+        super();
+        this.set("parts", parts);
+    }
+    getParts() {
+        return this.get("parts")
+    }
+}
+
+class OtherPerson {
+    parts: number;
+    constructor(parts: number) {
+        setProperty(this, "parts", parts);
+    }
+    getParts() {
+        return getProperty(this, "parts")
+    }
 }
 
 //// [keyofAndIndexedAccess.js]
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
 var Shape = (function () {
     function Shape() {
     }
     return Shape;
 }());
+var TaggedShape = (function (_super) {
+    __extends(TaggedShape, _super);
+    function TaggedShape() {
+        return _super.apply(this, arguments) || this;
+    }
+    return TaggedShape;
+}(Shape));
 var Item = (function () {
     function Item() {
     }
@@ -249,6 +308,15 @@ function f32(key) {
     var shape = { name: "foo", width: 5, height: 10, visible: true };
     return shape[key]; // Shape[K]
 }
+function f33(shape, key) {
+    var name = getProperty(shape, "name");
+    var prop = getProperty(shape, key);
+    return prop;
+}
+function f34(ts) {
+    var tag1 = f33(ts, "tag");
+    var tag2 = getProperty(ts, "tag");
+}
 var C = (function () {
     function C() {
     }
@@ -261,6 +329,39 @@ function f40(c) {
     var y = c["y"];
     var z = c["z"];
 }
+// Repros from #12011
+var Base = (function () {
+    function Base() {
+    }
+    Base.prototype.get = function (prop) {
+        return this[prop];
+    };
+    Base.prototype.set = function (prop, value) {
+        this[prop] = value;
+    };
+    return Base;
+}());
+var Person = (function (_super) {
+    __extends(Person, _super);
+    function Person(parts) {
+        var _this = _super.call(this) || this;
+        _this.set("parts", parts);
+        return _this;
+    }
+    Person.prototype.getParts = function () {
+        return this.get("parts");
+    };
+    return Person;
+}(Base));
+var OtherPerson = (function () {
+    function OtherPerson(parts) {
+        setProperty(this, "parts", parts);
+    }
+    OtherPerson.prototype.getParts = function () {
+        return getProperty(this, "parts");
+    };
+    return OtherPerson;
+}());
 
 
 //// [keyofAndIndexedAccess.d.ts]
@@ -270,6 +371,9 @@ declare class Shape {
     height: number;
     visible: boolean;
 }
+declare class TaggedShape extends Shape {
+    tag: string;
+}
 declare class Item {
     name: string;
     price: number;
@@ -342,9 +446,25 @@ declare function pluck<T, K extends keyof T>(array: T[], key: K): T[K][];
 declare function f30(shapes: Shape[]): void;
 declare function f31<K extends keyof Shape>(key: K): Shape[K];
 declare function f32<K extends "width" | "height">(key: K): Shape[K];
+declare function f33<S extends Shape, K extends keyof S>(shape: S, key: K): S[K];
+declare function f34(ts: TaggedShape): void;
 declare class C {
     x: string;
     protected y: string;
     private z;
 }
 declare function f40(c: C): void;
+declare class Base {
+    get<K extends keyof this>(prop: K): this[K];
+    set<K extends keyof this>(prop: K, value: this[K]): void;
+}
+declare class Person extends Base {
+    parts: number;
+    constructor(parts: number);
+    getParts(): number;
+}
+declare class OtherPerson {
+    parts: number;
+    constructor(parts: number);
+    getParts(): number;
+}
diff --git a/tests/baselines/reference/keyofAndIndexedAccess.symbols b/tests/baselines/reference/keyofAndIndexedAccess.symbols
index d3e967ed12504..a76cf32b8d2fa 100644
--- a/tests/baselines/reference/keyofAndIndexedAccess.symbols
+++ b/tests/baselines/reference/keyofAndIndexedAccess.symbols
@@ -16,562 +16,694 @@ class Shape {
 >visible : Symbol(Shape.visible, Decl(keyofAndIndexedAccess.ts, 4, 19))
 }
 
+class TaggedShape extends Shape {
+>TaggedShape : Symbol(TaggedShape, Decl(keyofAndIndexedAccess.ts, 6, 1))
+>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
+
+    tag: string;
+>tag : Symbol(TaggedShape.tag, Decl(keyofAndIndexedAccess.ts, 8, 33))
+}
+
 class Item {
->Item : Symbol(Item, Decl(keyofAndIndexedAccess.ts, 6, 1))
+>Item : Symbol(Item, Decl(keyofAndIndexedAccess.ts, 10, 1))
 
     name: string;
->name : Symbol(Item.name, Decl(keyofAndIndexedAccess.ts, 8, 12))
+>name : Symbol(Item.name, Decl(keyofAndIndexedAccess.ts, 12, 12))
 
     price: number;
->price : Symbol(Item.price, Decl(keyofAndIndexedAccess.ts, 9, 17))
+>price : Symbol(Item.price, Decl(keyofAndIndexedAccess.ts, 13, 17))
 }
 
 class Options {
->Options : Symbol(Options, Decl(keyofAndIndexedAccess.ts, 11, 1))
+>Options : Symbol(Options, Decl(keyofAndIndexedAccess.ts, 15, 1))
 
     visible: "yes" | "no";
->visible : Symbol(Options.visible, Decl(keyofAndIndexedAccess.ts, 13, 15))
+>visible : Symbol(Options.visible, Decl(keyofAndIndexedAccess.ts, 17, 15))
 }
 
 type Dictionary<T> = { [x: string]: T };
->Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 15, 1))
->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 17, 16))
->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 17, 24))
->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 17, 16))
+>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 19, 1))
+>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 21, 16))
+>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 21, 24))
+>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 21, 16))
 
 const enum E { A, B, C }
->E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 17, 40))
->A : Symbol(E.A, Decl(keyofAndIndexedAccess.ts, 19, 14))
->B : Symbol(E.B, Decl(keyofAndIndexedAccess.ts, 19, 17))
->C : Symbol(E.C, Decl(keyofAndIndexedAccess.ts, 19, 20))
+>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 21, 40))
+>A : Symbol(E.A, Decl(keyofAndIndexedAccess.ts, 23, 14))
+>B : Symbol(E.B, Decl(keyofAndIndexedAccess.ts, 23, 17))
+>C : Symbol(E.C, Decl(keyofAndIndexedAccess.ts, 23, 20))
 
 type K00 = keyof any;  // string | number
->K00 : Symbol(K00, Decl(keyofAndIndexedAccess.ts, 19, 24))
+>K00 : Symbol(K00, Decl(keyofAndIndexedAccess.ts, 23, 24))
 
 type K01 = keyof string;  // number | "toString" | "charAt" | ...
->K01 : Symbol(K01, Decl(keyofAndIndexedAccess.ts, 21, 21))
+>K01 : Symbol(K01, Decl(keyofAndIndexedAccess.ts, 25, 21))
 
 type K02 = keyof number;  // "toString" | "toFixed" | "toExponential" | ...
->K02 : Symbol(K02, Decl(keyofAndIndexedAccess.ts, 22, 24))
+>K02 : Symbol(K02, Decl(keyofAndIndexedAccess.ts, 26, 24))
 
 type K03 = keyof boolean;  // "valueOf"
->K03 : Symbol(K03, Decl(keyofAndIndexedAccess.ts, 23, 24))
+>K03 : Symbol(K03, Decl(keyofAndIndexedAccess.ts, 27, 24))
 
 type K04 = keyof void;  // never
->K04 : Symbol(K04, Decl(keyofAndIndexedAccess.ts, 24, 25))
+>K04 : Symbol(K04, Decl(keyofAndIndexedAccess.ts, 28, 25))
 
 type K05 = keyof undefined;  // never
->K05 : Symbol(K05, Decl(keyofAndIndexedAccess.ts, 25, 22))
+>K05 : Symbol(K05, Decl(keyofAndIndexedAccess.ts, 29, 22))
 
 type K06 = keyof null;  // never
->K06 : Symbol(K06, Decl(keyofAndIndexedAccess.ts, 26, 27))
+>K06 : Symbol(K06, Decl(keyofAndIndexedAccess.ts, 30, 27))
 
 type K07 = keyof never;  // never
->K07 : Symbol(K07, Decl(keyofAndIndexedAccess.ts, 27, 22))
+>K07 : Symbol(K07, Decl(keyofAndIndexedAccess.ts, 31, 22))
 
 type K10 = keyof Shape;  // "name" | "width" | "height" | "visible"
->K10 : Symbol(K10, Decl(keyofAndIndexedAccess.ts, 28, 23))
+>K10 : Symbol(K10, Decl(keyofAndIndexedAccess.ts, 32, 23))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
 
 type K11 = keyof Shape[];  // number | "length" | "toString" | ...
->K11 : Symbol(K11, Decl(keyofAndIndexedAccess.ts, 30, 23))
+>K11 : Symbol(K11, Decl(keyofAndIndexedAccess.ts, 34, 23))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
 
 type K12 = keyof Dictionary<Shape>;  // string | number
->K12 : Symbol(K12, Decl(keyofAndIndexedAccess.ts, 31, 25))
->Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 15, 1))
+>K12 : Symbol(K12, Decl(keyofAndIndexedAccess.ts, 35, 25))
+>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 19, 1))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
 
 type K13 = keyof {};  // never
->K13 : Symbol(K13, Decl(keyofAndIndexedAccess.ts, 32, 35))
+>K13 : Symbol(K13, Decl(keyofAndIndexedAccess.ts, 36, 35))
 
 type K14 = keyof Object;  // "constructor" | "toString" | ...
->K14 : Symbol(K14, Decl(keyofAndIndexedAccess.ts, 33, 20))
+>K14 : Symbol(K14, Decl(keyofAndIndexedAccess.ts, 37, 20))
 >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
 
 type K15 = keyof E;  // "toString" | "toFixed" | "toExponential" | ...
->K15 : Symbol(K15, Decl(keyofAndIndexedAccess.ts, 34, 24))
->E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 17, 40))
+>K15 : Symbol(K15, Decl(keyofAndIndexedAccess.ts, 38, 24))
+>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 21, 40))
 
 type K16 = keyof [string, number];  // number | "0" | "1" | "length" | "toString" | ...
->K16 : Symbol(K16, Decl(keyofAndIndexedAccess.ts, 35, 19))
+>K16 : Symbol(K16, Decl(keyofAndIndexedAccess.ts, 39, 19))
 
 type K17 = keyof (Shape | Item);  // "name"
->K17 : Symbol(K17, Decl(keyofAndIndexedAccess.ts, 36, 34))
+>K17 : Symbol(K17, Decl(keyofAndIndexedAccess.ts, 40, 34))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
->Item : Symbol(Item, Decl(keyofAndIndexedAccess.ts, 6, 1))
+>Item : Symbol(Item, Decl(keyofAndIndexedAccess.ts, 10, 1))
 
 type K18 = keyof (Shape & Item);  // "name" | "width" | "height" | "visible" | "price"
->K18 : Symbol(K18, Decl(keyofAndIndexedAccess.ts, 37, 32))
+>K18 : Symbol(K18, Decl(keyofAndIndexedAccess.ts, 41, 32))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
->Item : Symbol(Item, Decl(keyofAndIndexedAccess.ts, 6, 1))
+>Item : Symbol(Item, Decl(keyofAndIndexedAccess.ts, 10, 1))
 
 type KeyOf<T> = keyof T;
->KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 38, 32))
->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 40, 11))
->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 40, 11))
+>KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 42, 32))
+>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 44, 11))
+>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 44, 11))
 
 type K20 = KeyOf<Shape>;  // "name" | "width" | "height" | "visible"
->K20 : Symbol(K20, Decl(keyofAndIndexedAccess.ts, 40, 24))
->KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 38, 32))
+>K20 : Symbol(K20, Decl(keyofAndIndexedAccess.ts, 44, 24))
+>KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 42, 32))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
 
 type K21 = KeyOf<Dictionary<Shape>>;  // string | number
->K21 : Symbol(K21, Decl(keyofAndIndexedAccess.ts, 42, 24))
->KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 38, 32))
->Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 15, 1))
+>K21 : Symbol(K21, Decl(keyofAndIndexedAccess.ts, 46, 24))
+>KeyOf : Symbol(KeyOf, Decl(keyofAndIndexedAccess.ts, 42, 32))
+>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 19, 1))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
 
 type NAME = "name";
->NAME : Symbol(NAME, Decl(keyofAndIndexedAccess.ts, 43, 36))
+>NAME : Symbol(NAME, Decl(keyofAndIndexedAccess.ts, 47, 36))
 
 type WIDTH_OR_HEIGHT = "width" | "height";
->WIDTH_OR_HEIGHT : Symbol(WIDTH_OR_HEIGHT, Decl(keyofAndIndexedAccess.ts, 45, 19))
+>WIDTH_OR_HEIGHT : Symbol(WIDTH_OR_HEIGHT, Decl(keyofAndIndexedAccess.ts, 49, 19))
 
 type Q10 = Shape["name"];  // string
->Q10 : Symbol(Q10, Decl(keyofAndIndexedAccess.ts, 46, 42))
+>Q10 : Symbol(Q10, Decl(keyofAndIndexedAccess.ts, 50, 42))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
 
 type Q11 = Shape["width" | "height"];  // number
->Q11 : Symbol(Q11, Decl(keyofAndIndexedAccess.ts, 48, 25))
+>Q11 : Symbol(Q11, Decl(keyofAndIndexedAccess.ts, 52, 25))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
 
 type Q12 = Shape["name" | "visible"];  // string | boolean
->Q12 : Symbol(Q12, Decl(keyofAndIndexedAccess.ts, 49, 37))
+>Q12 : Symbol(Q12, Decl(keyofAndIndexedAccess.ts, 53, 37))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
 
 type Q20 = Shape[NAME];  // string
->Q20 : Symbol(Q20, Decl(keyofAndIndexedAccess.ts, 50, 37))
+>Q20 : Symbol(Q20, Decl(keyofAndIndexedAccess.ts, 54, 37))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
->NAME : Symbol(NAME, Decl(keyofAndIndexedAccess.ts, 43, 36))
+>NAME : Symbol(NAME, Decl(keyofAndIndexedAccess.ts, 47, 36))
 
 type Q21 = Shape[WIDTH_OR_HEIGHT];  // number
->Q21 : Symbol(Q21, Decl(keyofAndIndexedAccess.ts, 52, 23))
+>Q21 : Symbol(Q21, Decl(keyofAndIndexedAccess.ts, 56, 23))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
->WIDTH_OR_HEIGHT : Symbol(WIDTH_OR_HEIGHT, Decl(keyofAndIndexedAccess.ts, 45, 19))
+>WIDTH_OR_HEIGHT : Symbol(WIDTH_OR_HEIGHT, Decl(keyofAndIndexedAccess.ts, 49, 19))
 
 type Q30 = [string, number][0];  // string
->Q30 : Symbol(Q30, Decl(keyofAndIndexedAccess.ts, 53, 34))
+>Q30 : Symbol(Q30, Decl(keyofAndIndexedAccess.ts, 57, 34))
 
 type Q31 = [string, number][1];  // number
->Q31 : Symbol(Q31, Decl(keyofAndIndexedAccess.ts, 55, 31))
+>Q31 : Symbol(Q31, Decl(keyofAndIndexedAccess.ts, 59, 31))
 
 type Q32 = [string, number][2];  // string | number
->Q32 : Symbol(Q32, Decl(keyofAndIndexedAccess.ts, 56, 31))
+>Q32 : Symbol(Q32, Decl(keyofAndIndexedAccess.ts, 60, 31))
 
 type Q33 = [string, number][E.A];  // string
->Q33 : Symbol(Q33, Decl(keyofAndIndexedAccess.ts, 57, 31))
->E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 17, 40))
->A : Symbol(E.A, Decl(keyofAndIndexedAccess.ts, 19, 14))
+>Q33 : Symbol(Q33, Decl(keyofAndIndexedAccess.ts, 61, 31))
+>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 21, 40))
+>A : Symbol(E.A, Decl(keyofAndIndexedAccess.ts, 23, 14))
 
 type Q34 = [string, number][E.B];  // number
->Q34 : Symbol(Q34, Decl(keyofAndIndexedAccess.ts, 58, 33))
->E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 17, 40))
->B : Symbol(E.B, Decl(keyofAndIndexedAccess.ts, 19, 17))
+>Q34 : Symbol(Q34, Decl(keyofAndIndexedAccess.ts, 62, 33))
+>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 21, 40))
+>B : Symbol(E.B, Decl(keyofAndIndexedAccess.ts, 23, 17))
 
 type Q35 = [string, number][E.C];  // string | number
->Q35 : Symbol(Q35, Decl(keyofAndIndexedAccess.ts, 59, 33))
->E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 17, 40))
->C : Symbol(E.C, Decl(keyofAndIndexedAccess.ts, 19, 20))
+>Q35 : Symbol(Q35, Decl(keyofAndIndexedAccess.ts, 63, 33))
+>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 21, 40))
+>C : Symbol(E.C, Decl(keyofAndIndexedAccess.ts, 23, 20))
 
 type Q36 = [string, number]["0"];  // string
->Q36 : Symbol(Q36, Decl(keyofAndIndexedAccess.ts, 60, 33))
+>Q36 : Symbol(Q36, Decl(keyofAndIndexedAccess.ts, 64, 33))
 
 type Q37 = [string, number]["1"];  // string
->Q37 : Symbol(Q37, Decl(keyofAndIndexedAccess.ts, 61, 33))
+>Q37 : Symbol(Q37, Decl(keyofAndIndexedAccess.ts, 65, 33))
 
 type Q40 = (Shape | Options)["visible"];  // boolean | "yes" | "no"
->Q40 : Symbol(Q40, Decl(keyofAndIndexedAccess.ts, 62, 33))
+>Q40 : Symbol(Q40, Decl(keyofAndIndexedAccess.ts, 66, 33))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
->Options : Symbol(Options, Decl(keyofAndIndexedAccess.ts, 11, 1))
+>Options : Symbol(Options, Decl(keyofAndIndexedAccess.ts, 15, 1))
 
 type Q41 = (Shape & Options)["visible"];  // true & "yes" | true & "no" | false & "yes" | false & "no"
->Q41 : Symbol(Q41, Decl(keyofAndIndexedAccess.ts, 64, 40))
+>Q41 : Symbol(Q41, Decl(keyofAndIndexedAccess.ts, 68, 40))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
->Options : Symbol(Options, Decl(keyofAndIndexedAccess.ts, 11, 1))
+>Options : Symbol(Options, Decl(keyofAndIndexedAccess.ts, 15, 1))
 
 type Q50 = Dictionary<Shape>["howdy"];  // Shape
->Q50 : Symbol(Q50, Decl(keyofAndIndexedAccess.ts, 65, 40))
->Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 15, 1))
+>Q50 : Symbol(Q50, Decl(keyofAndIndexedAccess.ts, 69, 40))
+>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 19, 1))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
 
 type Q51 = Dictionary<Shape>[123];  // Shape
->Q51 : Symbol(Q51, Decl(keyofAndIndexedAccess.ts, 67, 38))
->Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 15, 1))
+>Q51 : Symbol(Q51, Decl(keyofAndIndexedAccess.ts, 71, 38))
+>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 19, 1))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
 
 type Q52 = Dictionary<Shape>[E.B];  // Shape
->Q52 : Symbol(Q52, Decl(keyofAndIndexedAccess.ts, 68, 34))
->Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 15, 1))
+>Q52 : Symbol(Q52, Decl(keyofAndIndexedAccess.ts, 72, 34))
+>Dictionary : Symbol(Dictionary, Decl(keyofAndIndexedAccess.ts, 19, 1))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
->E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 17, 40))
->B : Symbol(E.B, Decl(keyofAndIndexedAccess.ts, 19, 17))
+>E : Symbol(E, Decl(keyofAndIndexedAccess.ts, 21, 40))
+>B : Symbol(E.B, Decl(keyofAndIndexedAccess.ts, 23, 17))
 
 declare let cond: boolean;
->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
+>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
 
 function getProperty<T, K extends keyof T>(obj: T, key: K) {
->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 73, 21))
->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 73, 23))
->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 73, 21))
->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 73, 43))
->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 73, 21))
->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 73, 50))
->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 73, 23))
-
-    return obj[key];
->obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 73, 43))
->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 73, 50))
-}
-
-function setProperty<T, K extends keyof T>(obj: T, key: K, value: T[K]) {
->setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 75, 1))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
 >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 77, 21))
 >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 77, 23))
 >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 77, 21))
 >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 77, 43))
 >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 77, 21))
 >key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 77, 50))
->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 77, 23))
->value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 77, 58))
->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 77, 21))
 >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 77, 23))
 
-    obj[key] = value;
+    return obj[key];
 >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 77, 43))
 >key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 77, 50))
->value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 77, 58))
+}
+
+function setProperty<T, K extends keyof T>(obj: T, key: K, value: T[K]) {
+>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1))
+>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 81, 21))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 81, 23))
+>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 81, 21))
+>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 81, 43))
+>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 81, 21))
+>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 81, 50))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 81, 23))
+>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 81, 58))
+>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 81, 21))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 81, 23))
+
+    obj[key] = value;
+>obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 81, 43))
+>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 81, 50))
+>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 81, 58))
 }
 
 function f10(shape: Shape) {
->f10 : Symbol(f10, Decl(keyofAndIndexedAccess.ts, 79, 1))
->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 81, 13))
+>f10 : Symbol(f10, Decl(keyofAndIndexedAccess.ts, 83, 1))
+>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
 
     let name = getProperty(shape, "name");  // string
->name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 82, 7))
->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 81, 13))
+>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 86, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13))
 
     let widthOrHeight = getProperty(shape, cond ? "width" : "height");  // number
->widthOrHeight : Symbol(widthOrHeight, Decl(keyofAndIndexedAccess.ts, 83, 7))
->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 81, 13))
->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
+>widthOrHeight : Symbol(widthOrHeight, Decl(keyofAndIndexedAccess.ts, 87, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13))
+>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
 
     let nameOrVisible = getProperty(shape, cond ? "name" : "visible");  // string | boolean
->nameOrVisible : Symbol(nameOrVisible, Decl(keyofAndIndexedAccess.ts, 84, 7))
->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 81, 13))
->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
+>nameOrVisible : Symbol(nameOrVisible, Decl(keyofAndIndexedAccess.ts, 88, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13))
+>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
 
     setProperty(shape, "name", "rectangle");
->setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 75, 1))
->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 81, 13))
+>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1))
+>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13))
 
     setProperty(shape, cond ? "width" : "height", 10);
->setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 75, 1))
->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 81, 13))
->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
+>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1))
+>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13))
+>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
 
     setProperty(shape, cond ? "name" : "visible", true);  // Technically not safe
->setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 75, 1))
->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 81, 13))
->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
+>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1))
+>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 85, 13))
+>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
 }
 
 function f11(a: Shape[]) {
->f11 : Symbol(f11, Decl(keyofAndIndexedAccess.ts, 88, 1))
->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 90, 13))
+>f11 : Symbol(f11, Decl(keyofAndIndexedAccess.ts, 92, 1))
+>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 94, 13))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
 
     let len = getProperty(a, "length");  // number
->len : Symbol(len, Decl(keyofAndIndexedAccess.ts, 91, 7))
->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 90, 13))
+>len : Symbol(len, Decl(keyofAndIndexedAccess.ts, 95, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 94, 13))
 
     let shape = getProperty(a, 1000);    // Shape
->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 92, 7))
->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 90, 13))
+>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 96, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 94, 13))
 
     setProperty(a, 1000, getProperty(a, 1001));
->setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 75, 1))
->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 90, 13))
->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
->a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 90, 13))
+>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1))
+>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 94, 13))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 94, 13))
 }
 
 function f12(t: [Shape, boolean]) {
->f12 : Symbol(f12, Decl(keyofAndIndexedAccess.ts, 94, 1))
->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 96, 13))
+>f12 : Symbol(f12, Decl(keyofAndIndexedAccess.ts, 98, 1))
+>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
 
     let len = getProperty(t, "length");
->len : Symbol(len, Decl(keyofAndIndexedAccess.ts, 97, 7))
->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 96, 13))
+>len : Symbol(len, Decl(keyofAndIndexedAccess.ts, 101, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13))
 
     let s1 = getProperty(t, 0);    // Shape
->s1 : Symbol(s1, Decl(keyofAndIndexedAccess.ts, 98, 7))
->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 96, 13))
+>s1 : Symbol(s1, Decl(keyofAndIndexedAccess.ts, 102, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13))
 
     let s2 = getProperty(t, "0");  // Shape
->s2 : Symbol(s2, Decl(keyofAndIndexedAccess.ts, 99, 7))
->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 96, 13))
+>s2 : Symbol(s2, Decl(keyofAndIndexedAccess.ts, 103, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13))
 
     let b1 = getProperty(t, 1);    // boolean
->b1 : Symbol(b1, Decl(keyofAndIndexedAccess.ts, 100, 7))
->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 96, 13))
+>b1 : Symbol(b1, Decl(keyofAndIndexedAccess.ts, 104, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13))
 
     let b2 = getProperty(t, "1");  // boolean
->b2 : Symbol(b2, Decl(keyofAndIndexedAccess.ts, 101, 7))
->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 96, 13))
+>b2 : Symbol(b2, Decl(keyofAndIndexedAccess.ts, 105, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13))
 
     let x1 = getProperty(t, 2);    // Shape | boolean
->x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 102, 7))
->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
->t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 96, 13))
+>x1 : Symbol(x1, Decl(keyofAndIndexedAccess.ts, 106, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>t : Symbol(t, Decl(keyofAndIndexedAccess.ts, 100, 13))
 }
 
 function f13(foo: any, bar: any) {
->f13 : Symbol(f13, Decl(keyofAndIndexedAccess.ts, 103, 1))
->foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 105, 13))
->bar : Symbol(bar, Decl(keyofAndIndexedAccess.ts, 105, 22))
+>f13 : Symbol(f13, Decl(keyofAndIndexedAccess.ts, 107, 1))
+>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 109, 13))
+>bar : Symbol(bar, Decl(keyofAndIndexedAccess.ts, 109, 22))
 
     let x = getProperty(foo, "x");  // any
->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 106, 7))
->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
->foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 105, 13))
+>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 110, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 109, 13))
 
     let y = getProperty(foo, 100);  // any
->y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 107, 7))
->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
->foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 105, 13))
+>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 111, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 109, 13))
 
     let z = getProperty(foo, bar);  // any
->z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 108, 7))
->getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 71, 26))
->foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 105, 13))
->bar : Symbol(bar, Decl(keyofAndIndexedAccess.ts, 105, 22))
+>z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 112, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>foo : Symbol(foo, Decl(keyofAndIndexedAccess.ts, 109, 13))
+>bar : Symbol(bar, Decl(keyofAndIndexedAccess.ts, 109, 22))
 }
 
 class Component<PropType> {
->Component : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 109, 1))
->PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 111, 16))
+>Component : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 113, 1))
+>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 115, 16))
 
     props: PropType;
->props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 111, 27))
->PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 111, 16))
+>props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 115, 27))
+>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 115, 16))
 
     getProperty<K extends keyof PropType>(key: K) {
->getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20))
->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 113, 16))
->PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 111, 16))
->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 113, 42))
->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 113, 16))
+>getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 116, 20))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 117, 16))
+>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 115, 16))
+>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 117, 42))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 117, 16))
 
         return this.props[key];
->this.props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 111, 27))
->this : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 109, 1))
->props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 111, 27))
->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 113, 42))
+>this.props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 115, 27))
+>this : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 113, 1))
+>props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 115, 27))
+>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 117, 42))
     }
     setProperty<K extends keyof PropType>(key: K, value: PropType[K]) {
->setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5))
->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 116, 16))
->PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 111, 16))
->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 116, 42))
->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 116, 16))
->value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 116, 49))
->PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 111, 16))
->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 116, 16))
+>setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 119, 5))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 120, 16))
+>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 115, 16))
+>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 120, 42))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 120, 16))
+>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 120, 49))
+>PropType : Symbol(PropType, Decl(keyofAndIndexedAccess.ts, 115, 16))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 120, 16))
 
         this.props[key] = value;
->this.props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 111, 27))
->this : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 109, 1))
->props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 111, 27))
->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 116, 42))
->value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 116, 49))
+>this.props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 115, 27))
+>this : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 113, 1))
+>props : Symbol(Component.props, Decl(keyofAndIndexedAccess.ts, 115, 27))
+>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 120, 42))
+>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 120, 49))
     }
 }
 
 function f20(component: Component<Shape>) {
->f20 : Symbol(f20, Decl(keyofAndIndexedAccess.ts, 119, 1))
->component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13))
->Component : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 109, 1))
+>f20 : Symbol(f20, Decl(keyofAndIndexedAccess.ts, 123, 1))
+>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 125, 13))
+>Component : Symbol(Component, Decl(keyofAndIndexedAccess.ts, 113, 1))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
 
     let name = component.getProperty("name");  // string
->name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 122, 7))
->component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20))
->component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13))
->getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20))
+>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 126, 7))
+>component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 116, 20))
+>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 125, 13))
+>getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 116, 20))
 
     let widthOrHeight = component.getProperty(cond ? "width" : "height");  // number
->widthOrHeight : Symbol(widthOrHeight, Decl(keyofAndIndexedAccess.ts, 123, 7))
->component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20))
->component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13))
->getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20))
->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
+>widthOrHeight : Symbol(widthOrHeight, Decl(keyofAndIndexedAccess.ts, 127, 7))
+>component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 116, 20))
+>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 125, 13))
+>getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 116, 20))
+>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
 
     let nameOrVisible = component.getProperty(cond ? "name" : "visible");  // string | boolean
->nameOrVisible : Symbol(nameOrVisible, Decl(keyofAndIndexedAccess.ts, 124, 7))
->component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20))
->component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13))
->getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 112, 20))
->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
+>nameOrVisible : Symbol(nameOrVisible, Decl(keyofAndIndexedAccess.ts, 128, 7))
+>component.getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 116, 20))
+>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 125, 13))
+>getProperty : Symbol(Component.getProperty, Decl(keyofAndIndexedAccess.ts, 116, 20))
+>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
 
     component.setProperty("name", "rectangle");
->component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5))
->component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13))
->setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5))
+>component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 119, 5))
+>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 125, 13))
+>setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 119, 5))
 
     component.setProperty(cond ? "width" : "height", 10)
->component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5))
->component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13))
->setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5))
->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
+>component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 119, 5))
+>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 125, 13))
+>setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 119, 5))
+>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
 
     component.setProperty(cond ? "name" : "visible", true);  // Technically not safe
->component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5))
->component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 121, 13))
->setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 115, 5))
->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
+>component.setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 119, 5))
+>component : Symbol(component, Decl(keyofAndIndexedAccess.ts, 125, 13))
+>setProperty : Symbol(Component.setProperty, Decl(keyofAndIndexedAccess.ts, 119, 5))
+>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
 }
 
 function pluck<T, K extends keyof T>(array: T[], key: K) {
->pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 128, 1))
->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 130, 15))
->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 130, 17))
->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 130, 15))
->array : Symbol(array, Decl(keyofAndIndexedAccess.ts, 130, 37))
->T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 130, 15))
->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 130, 48))
->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 130, 17))
+>pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 132, 1))
+>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 134, 15))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 134, 17))
+>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 134, 15))
+>array : Symbol(array, Decl(keyofAndIndexedAccess.ts, 134, 37))
+>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 134, 15))
+>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 134, 48))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 134, 17))
 
     return array.map(x => x[key]);
 >array.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
->array : Symbol(array, Decl(keyofAndIndexedAccess.ts, 130, 37))
+>array : Symbol(array, Decl(keyofAndIndexedAccess.ts, 134, 37))
 >map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 131, 21))
->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 131, 21))
->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 130, 48))
+>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 135, 21))
+>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 135, 21))
+>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 134, 48))
 }
 
 function f30(shapes: Shape[]) {
->f30 : Symbol(f30, Decl(keyofAndIndexedAccess.ts, 132, 1))
->shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 134, 13))
+>f30 : Symbol(f30, Decl(keyofAndIndexedAccess.ts, 136, 1))
+>shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 138, 13))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
 
     let names = pluck(shapes, "name");    // string[]
->names : Symbol(names, Decl(keyofAndIndexedAccess.ts, 135, 7))
->pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 128, 1))
->shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 134, 13))
+>names : Symbol(names, Decl(keyofAndIndexedAccess.ts, 139, 7))
+>pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 132, 1))
+>shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 138, 13))
 
     let widths = pluck(shapes, "width");  // number[]
->widths : Symbol(widths, Decl(keyofAndIndexedAccess.ts, 136, 7))
->pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 128, 1))
->shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 134, 13))
+>widths : Symbol(widths, Decl(keyofAndIndexedAccess.ts, 140, 7))
+>pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 132, 1))
+>shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 138, 13))
 
     let nameOrVisibles = pluck(shapes, cond ? "name" : "visible");  // (string | boolean)[]
->nameOrVisibles : Symbol(nameOrVisibles, Decl(keyofAndIndexedAccess.ts, 137, 7))
->pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 128, 1))
->shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 134, 13))
->cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 71, 11))
+>nameOrVisibles : Symbol(nameOrVisibles, Decl(keyofAndIndexedAccess.ts, 141, 7))
+>pluck : Symbol(pluck, Decl(keyofAndIndexedAccess.ts, 132, 1))
+>shapes : Symbol(shapes, Decl(keyofAndIndexedAccess.ts, 138, 13))
+>cond : Symbol(cond, Decl(keyofAndIndexedAccess.ts, 75, 11))
 }
 
 function f31<K extends keyof Shape>(key: K) {
->f31 : Symbol(f31, Decl(keyofAndIndexedAccess.ts, 138, 1))
->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 140, 13))
+>f31 : Symbol(f31, Decl(keyofAndIndexedAccess.ts, 142, 1))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 144, 13))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 140, 36))
->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 140, 13))
+>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 144, 36))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 144, 13))
 
     const shape: Shape = { name: "foo", width: 5, height: 10, visible: true };
->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 141, 9))
+>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 145, 9))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
->name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 141, 26))
->width : Symbol(width, Decl(keyofAndIndexedAccess.ts, 141, 39))
->height : Symbol(height, Decl(keyofAndIndexedAccess.ts, 141, 49))
->visible : Symbol(visible, Decl(keyofAndIndexedAccess.ts, 141, 61))
+>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 145, 26))
+>width : Symbol(width, Decl(keyofAndIndexedAccess.ts, 145, 39))
+>height : Symbol(height, Decl(keyofAndIndexedAccess.ts, 145, 49))
+>visible : Symbol(visible, Decl(keyofAndIndexedAccess.ts, 145, 61))
 
     return shape[key];  // Shape[K]
->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 141, 9))
->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 140, 36))
+>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 145, 9))
+>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 144, 36))
 }
 
 function f32<K extends "width" | "height">(key: K) {
->f32 : Symbol(f32, Decl(keyofAndIndexedAccess.ts, 143, 1))
->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 145, 13))
->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 145, 43))
->K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 145, 13))
+>f32 : Symbol(f32, Decl(keyofAndIndexedAccess.ts, 147, 1))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 149, 13))
+>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 149, 43))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 149, 13))
 
     const shape: Shape = { name: "foo", width: 5, height: 10, visible: true };
->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 146, 9))
+>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 150, 9))
 >Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
->name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 146, 26))
->width : Symbol(width, Decl(keyofAndIndexedAccess.ts, 146, 39))
->height : Symbol(height, Decl(keyofAndIndexedAccess.ts, 146, 49))
->visible : Symbol(visible, Decl(keyofAndIndexedAccess.ts, 146, 61))
+>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 150, 26))
+>width : Symbol(width, Decl(keyofAndIndexedAccess.ts, 150, 39))
+>height : Symbol(height, Decl(keyofAndIndexedAccess.ts, 150, 49))
+>visible : Symbol(visible, Decl(keyofAndIndexedAccess.ts, 150, 61))
 
     return shape[key];  // Shape[K]
->shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 146, 9))
->key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 145, 43))
+>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 150, 9))
+>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 149, 43))
+}
+
+function f33<S extends Shape, K extends keyof S>(shape: S, key: K) {
+>f33 : Symbol(f33, Decl(keyofAndIndexedAccess.ts, 152, 1))
+>S : Symbol(S, Decl(keyofAndIndexedAccess.ts, 154, 13))
+>Shape : Symbol(Shape, Decl(keyofAndIndexedAccess.ts, 0, 0))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 154, 29))
+>S : Symbol(S, Decl(keyofAndIndexedAccess.ts, 154, 13))
+>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 154, 49))
+>S : Symbol(S, Decl(keyofAndIndexedAccess.ts, 154, 13))
+>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 154, 58))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 154, 29))
+
+    let name = getProperty(shape, "name");
+>name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 155, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 154, 49))
+
+    let prop = getProperty(shape, key);
+>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 156, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>shape : Symbol(shape, Decl(keyofAndIndexedAccess.ts, 154, 49))
+>key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 154, 58))
+
+    return prop;
+>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 156, 7))
+}
+
+function f34(ts: TaggedShape) {
+>f34 : Symbol(f34, Decl(keyofAndIndexedAccess.ts, 158, 1))
+>ts : Symbol(ts, Decl(keyofAndIndexedAccess.ts, 160, 13))
+>TaggedShape : Symbol(TaggedShape, Decl(keyofAndIndexedAccess.ts, 6, 1))
+
+    let tag1 = f33(ts, "tag");
+>tag1 : Symbol(tag1, Decl(keyofAndIndexedAccess.ts, 161, 7))
+>f33 : Symbol(f33, Decl(keyofAndIndexedAccess.ts, 152, 1))
+>ts : Symbol(ts, Decl(keyofAndIndexedAccess.ts, 160, 13))
+
+    let tag2 = getProperty(ts, "tag");
+>tag2 : Symbol(tag2, Decl(keyofAndIndexedAccess.ts, 162, 7))
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>ts : Symbol(ts, Decl(keyofAndIndexedAccess.ts, 160, 13))
 }
 
 class C {
->C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 148, 1))
+>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 163, 1))
 
     public x: string;
->x : Symbol(C.x, Decl(keyofAndIndexedAccess.ts, 150, 9))
+>x : Symbol(C.x, Decl(keyofAndIndexedAccess.ts, 165, 9))
 
     protected y: string;
->y : Symbol(C.y, Decl(keyofAndIndexedAccess.ts, 151, 21))
+>y : Symbol(C.y, Decl(keyofAndIndexedAccess.ts, 166, 21))
 
     private z: string;
->z : Symbol(C.z, Decl(keyofAndIndexedAccess.ts, 152, 24))
+>z : Symbol(C.z, Decl(keyofAndIndexedAccess.ts, 167, 24))
 }
 
 // Indexed access expressions have always permitted access to private and protected members.
 // For consistency we also permit such access in indexed access types.
 function f40(c: C) {
->f40 : Symbol(f40, Decl(keyofAndIndexedAccess.ts, 154, 1))
->c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 158, 13))
->C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 148, 1))
+>f40 : Symbol(f40, Decl(keyofAndIndexedAccess.ts, 169, 1))
+>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 173, 13))
+>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 163, 1))
 
     type X = C["x"];
->X : Symbol(X, Decl(keyofAndIndexedAccess.ts, 158, 20))
->C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 148, 1))
+>X : Symbol(X, Decl(keyofAndIndexedAccess.ts, 173, 20))
+>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 163, 1))
 
     type Y = C["y"];
->Y : Symbol(Y, Decl(keyofAndIndexedAccess.ts, 159, 20))
->C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 148, 1))
+>Y : Symbol(Y, Decl(keyofAndIndexedAccess.ts, 174, 20))
+>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 163, 1))
 
     type Z = C["z"];
->Z : Symbol(Z, Decl(keyofAndIndexedAccess.ts, 160, 20))
->C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 148, 1))
+>Z : Symbol(Z, Decl(keyofAndIndexedAccess.ts, 175, 20))
+>C : Symbol(C, Decl(keyofAndIndexedAccess.ts, 163, 1))
 
     let x: X = c["x"];
->x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 162, 7))
->X : Symbol(X, Decl(keyofAndIndexedAccess.ts, 158, 20))
->c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 158, 13))
->"x" : Symbol(C.x, Decl(keyofAndIndexedAccess.ts, 150, 9))
+>x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 177, 7))
+>X : Symbol(X, Decl(keyofAndIndexedAccess.ts, 173, 20))
+>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 173, 13))
+>"x" : Symbol(C.x, Decl(keyofAndIndexedAccess.ts, 165, 9))
 
     let y: Y = c["y"];
->y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 163, 7))
->Y : Symbol(Y, Decl(keyofAndIndexedAccess.ts, 159, 20))
->c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 158, 13))
->"y" : Symbol(C.y, Decl(keyofAndIndexedAccess.ts, 151, 21))
+>y : Symbol(y, Decl(keyofAndIndexedAccess.ts, 178, 7))
+>Y : Symbol(Y, Decl(keyofAndIndexedAccess.ts, 174, 20))
+>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 173, 13))
+>"y" : Symbol(C.y, Decl(keyofAndIndexedAccess.ts, 166, 21))
 
     let z: Z = c["z"];
->z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 164, 7))
->Z : Symbol(Z, Decl(keyofAndIndexedAccess.ts, 160, 20))
->c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 158, 13))
->"z" : Symbol(C.z, Decl(keyofAndIndexedAccess.ts, 152, 24))
+>z : Symbol(z, Decl(keyofAndIndexedAccess.ts, 179, 7))
+>Z : Symbol(Z, Decl(keyofAndIndexedAccess.ts, 175, 20))
+>c : Symbol(c, Decl(keyofAndIndexedAccess.ts, 173, 13))
+>"z" : Symbol(C.z, Decl(keyofAndIndexedAccess.ts, 167, 24))
+}
+
+// Repros from #12011
+
+class Base {
+>Base : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 180, 1))
+
+    get<K extends keyof this>(prop: K) {
+>get : Symbol(Base.get, Decl(keyofAndIndexedAccess.ts, 184, 12))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 185, 8))
+>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 185, 30))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 185, 8))
+
+        return this[prop];
+>this : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 180, 1))
+>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 185, 30))
+    }
+    set<K extends keyof this>(prop: K, value: this[K]) {
+>set : Symbol(Base.set, Decl(keyofAndIndexedAccess.ts, 187, 5))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 188, 8))
+>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 188, 30))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 188, 8))
+>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 188, 38))
+>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 188, 8))
+
+        this[prop] = value;
+>this : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 180, 1))
+>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 188, 30))
+>value : Symbol(value, Decl(keyofAndIndexedAccess.ts, 188, 38))
+    }
+}
+
+class Person extends Base {
+>Person : Symbol(Person, Decl(keyofAndIndexedAccess.ts, 191, 1))
+>Base : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 180, 1))
+
+    parts: number;
+>parts : Symbol(Person.parts, Decl(keyofAndIndexedAccess.ts, 193, 27))
+
+    constructor(parts: number) {
+>parts : Symbol(parts, Decl(keyofAndIndexedAccess.ts, 195, 16))
+
+        super();
+>super : Symbol(Base, Decl(keyofAndIndexedAccess.ts, 180, 1))
+
+        this.set("parts", parts);
+>this.set : Symbol(Base.set, Decl(keyofAndIndexedAccess.ts, 187, 5))
+>this : Symbol(Person, Decl(keyofAndIndexedAccess.ts, 191, 1))
+>set : Symbol(Base.set, Decl(keyofAndIndexedAccess.ts, 187, 5))
+>parts : Symbol(parts, Decl(keyofAndIndexedAccess.ts, 195, 16))
+    }
+    getParts() {
+>getParts : Symbol(Person.getParts, Decl(keyofAndIndexedAccess.ts, 198, 5))
+
+        return this.get("parts")
+>this.get : Symbol(Base.get, Decl(keyofAndIndexedAccess.ts, 184, 12))
+>this : Symbol(Person, Decl(keyofAndIndexedAccess.ts, 191, 1))
+>get : Symbol(Base.get, Decl(keyofAndIndexedAccess.ts, 184, 12))
+    }
+}
+
+class OtherPerson {
+>OtherPerson : Symbol(OtherPerson, Decl(keyofAndIndexedAccess.ts, 202, 1))
+
+    parts: number;
+>parts : Symbol(OtherPerson.parts, Decl(keyofAndIndexedAccess.ts, 204, 19))
+
+    constructor(parts: number) {
+>parts : Symbol(parts, Decl(keyofAndIndexedAccess.ts, 206, 16))
+
+        setProperty(this, "parts", parts);
+>setProperty : Symbol(setProperty, Decl(keyofAndIndexedAccess.ts, 79, 1))
+>this : Symbol(OtherPerson, Decl(keyofAndIndexedAccess.ts, 202, 1))
+>parts : Symbol(parts, Decl(keyofAndIndexedAccess.ts, 206, 16))
+    }
+    getParts() {
+>getParts : Symbol(OtherPerson.getParts, Decl(keyofAndIndexedAccess.ts, 208, 5))
+
+        return getProperty(this, "parts")
+>getProperty : Symbol(getProperty, Decl(keyofAndIndexedAccess.ts, 75, 26))
+>this : Symbol(OtherPerson, Decl(keyofAndIndexedAccess.ts, 202, 1))
+    }
 }
diff --git a/tests/baselines/reference/keyofAndIndexedAccess.types b/tests/baselines/reference/keyofAndIndexedAccess.types
index 74c06a2535da7..a5395db8292ae 100644
--- a/tests/baselines/reference/keyofAndIndexedAccess.types
+++ b/tests/baselines/reference/keyofAndIndexedAccess.types
@@ -16,6 +16,14 @@ class Shape {
 >visible : boolean
 }
 
+class TaggedShape extends Shape {
+>TaggedShape : TaggedShape
+>Shape : Shape
+
+    tag: string;
+>tag : string
+}
+
 class Item {
 >Item : Item
 
@@ -626,6 +634,55 @@ function f32<K extends "width" | "height">(key: K) {
 >key : K
 }
 
+function f33<S extends Shape, K extends keyof S>(shape: S, key: K) {
+>f33 : <S extends Shape, K extends keyof S>(shape: S, key: K) => S[K]
+>S : S
+>Shape : Shape
+>K : K
+>S : S
+>shape : S
+>S : S
+>key : K
+>K : K
+
+    let name = getProperty(shape, "name");
+>name : string
+>getProperty(shape, "name") : string
+>getProperty : <T, K extends keyof T>(obj: T, key: K) => T[K]
+>shape : S
+>"name" : "name"
+
+    let prop = getProperty(shape, key);
+>prop : S[K]
+>getProperty(shape, key) : S[K]
+>getProperty : <T, K extends keyof T>(obj: T, key: K) => T[K]
+>shape : S
+>key : K
+
+    return prop;
+>prop : S[K]
+}
+
+function f34(ts: TaggedShape) {
+>f34 : (ts: TaggedShape) => void
+>ts : TaggedShape
+>TaggedShape : TaggedShape
+
+    let tag1 = f33(ts, "tag");
+>tag1 : string
+>f33(ts, "tag") : string
+>f33 : <S extends Shape, K extends keyof S>(shape: S, key: K) => S[K]
+>ts : TaggedShape
+>"tag" : "tag"
+
+    let tag2 = getProperty(ts, "tag");
+>tag2 : string
+>getProperty(ts, "tag") : string
+>getProperty : <T, K extends keyof T>(obj: T, key: K) => T[K]
+>ts : TaggedShape
+>"tag" : "tag"
+}
+
 class C {
 >C : C
 
@@ -679,3 +736,97 @@ function f40(c: C) {
 >c : C
 >"z" : "z"
 }
+
+// Repros from #12011
+
+class Base {
+>Base : Base
+
+    get<K extends keyof this>(prop: K) {
+>get : <K extends keyof this>(prop: K) => this[K]
+>K : K
+>prop : K
+>K : K
+
+        return this[prop];
+>this[prop] : this[K]
+>this : this
+>prop : K
+    }
+    set<K extends keyof this>(prop: K, value: this[K]) {
+>set : <K extends keyof this>(prop: K, value: this[K]) => void
+>K : K
+>prop : K
+>K : K
+>value : this[K]
+>K : K
+
+        this[prop] = value;
+>this[prop] = value : this[K]
+>this[prop] : this[K]
+>this : this
+>prop : K
+>value : this[K]
+    }
+}
+
+class Person extends Base {
+>Person : Person
+>Base : Base
+
+    parts: number;
+>parts : number
+
+    constructor(parts: number) {
+>parts : number
+
+        super();
+>super() : void
+>super : typeof Base
+
+        this.set("parts", parts);
+>this.set("parts", parts) : void
+>this.set : <K extends keyof this>(prop: K, value: this[K]) => void
+>this : this
+>set : <K extends keyof this>(prop: K, value: this[K]) => void
+>"parts" : "parts"
+>parts : number
+    }
+    getParts() {
+>getParts : () => number
+
+        return this.get("parts")
+>this.get("parts") : number
+>this.get : <K extends keyof this>(prop: K) => this[K]
+>this : this
+>get : <K extends keyof this>(prop: K) => this[K]
+>"parts" : "parts"
+    }
+}
+
+class OtherPerson {
+>OtherPerson : OtherPerson
+
+    parts: number;
+>parts : number
+
+    constructor(parts: number) {
+>parts : number
+
+        setProperty(this, "parts", parts);
+>setProperty(this, "parts", parts) : void
+>setProperty : <T, K extends keyof T>(obj: T, key: K, value: T[K]) => void
+>this : this
+>"parts" : "parts"
+>parts : number
+    }
+    getParts() {
+>getParts : () => number
+
+        return getProperty(this, "parts")
+>getProperty(this, "parts") : number
+>getProperty : <T, K extends keyof T>(obj: T, key: K) => T[K]
+>this : this
+>"parts" : "parts"
+    }
+}
diff --git a/tests/baselines/reference/keywordInJsxIdentifier.symbols b/tests/baselines/reference/keywordInJsxIdentifier.symbols
index 3cb977bee81d6..73ee737616440 100644
--- a/tests/baselines/reference/keywordInJsxIdentifier.symbols
+++ b/tests/baselines/reference/keywordInJsxIdentifier.symbols
@@ -5,17 +5,17 @@ declare var React: any;
 
 <foo class-id/>;
 >foo : Symbol(unknown)
->class-id : Symbol(unknown)
+>class-id : Symbol(class-id, Decl(keywordInJsxIdentifier.tsx, 2, 4))
 
 <foo class/>;
 >foo : Symbol(unknown)
->class : Symbol(unknown)
+>class : Symbol(class, Decl(keywordInJsxIdentifier.tsx, 3, 4))
 
 <foo class-id="1"/>;
 >foo : Symbol(unknown)
->class-id : Symbol(unknown)
+>class-id : Symbol(class-id, Decl(keywordInJsxIdentifier.tsx, 4, 4))
 
 <foo class="1"/>;
 >foo : Symbol(unknown)
->class : Symbol(unknown)
+>class : Symbol(class, Decl(keywordInJsxIdentifier.tsx, 5, 4))
 
diff --git a/tests/baselines/reference/keywordInJsxIdentifier.types b/tests/baselines/reference/keywordInJsxIdentifier.types
index 745fa5998b59a..0e4c4387cf47e 100644
--- a/tests/baselines/reference/keywordInJsxIdentifier.types
+++ b/tests/baselines/reference/keywordInJsxIdentifier.types
@@ -6,20 +6,20 @@ declare var React: any;
 <foo class-id/>;
 ><foo class-id/> : any
 >foo : any
->class-id : any
+>class-id : true
 
 <foo class/>;
 ><foo class/> : any
 >foo : any
->class : any
+>class : true
 
 <foo class-id="1"/>;
 ><foo class-id="1"/> : any
 >foo : any
->class-id : any
+>class-id : string
 
 <foo class="1"/>;
 ><foo class="1"/> : any
 >foo : any
->class : any
+>class : string
 
diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt
index ac25edc1bd565..668f037a03b4d 100644
--- a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt
+++ b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt
@@ -1,9 +1,11 @@
 error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
 error TS5055: Cannot write file 'SameNameDTsNotSpecifiedWithAllowJs/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 
 
 !!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
 !!! error TS5055: Cannot write file 'SameNameDTsNotSpecifiedWithAllowJs/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== SameNameDTsNotSpecifiedWithAllowJs/a.d.ts (0 errors) ====
     declare var a: number;
 ==== SameNameDTsNotSpecifiedWithAllowJs/a.js (0 errors) ====
diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt
index ac25edc1bd565..668f037a03b4d 100644
--- a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt
+++ b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt
@@ -1,9 +1,11 @@
 error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
 error TS5055: Cannot write file 'SameNameDTsNotSpecifiedWithAllowJs/a.js' because it would overwrite input file.
+  Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 
 
 !!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
 !!! error TS5055: Cannot write file 'SameNameDTsNotSpecifiedWithAllowJs/a.js' because it would overwrite input file.
+!!! error TS5055:   Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
 ==== SameNameDTsNotSpecifiedWithAllowJs/a.d.ts (0 errors) ====
     declare var a: number;
 ==== SameNameDTsNotSpecifiedWithAllowJs/a.js (0 errors) ====
diff --git a/tests/baselines/reference/reactNamespaceImportPresevation.symbols b/tests/baselines/reference/reactNamespaceImportPresevation.symbols
index e2f530d31ba73..caeca7cefcb99 100644
--- a/tests/baselines/reference/reactNamespaceImportPresevation.symbols
+++ b/tests/baselines/reference/reactNamespaceImportPresevation.symbols
@@ -17,5 +17,5 @@ declare var foo: any;
 
 <foo data/>;
 >foo : Symbol(unknown)
->data : Symbol(unknown)
+>data : Symbol(data, Decl(test.tsx, 3, 4))
 
diff --git a/tests/baselines/reference/reactNamespaceImportPresevation.types b/tests/baselines/reference/reactNamespaceImportPresevation.types
index adb1d60d2d5c9..931a86d248de0 100644
--- a/tests/baselines/reference/reactNamespaceImportPresevation.types
+++ b/tests/baselines/reference/reactNamespaceImportPresevation.types
@@ -18,5 +18,5 @@ declare var foo: any;
 <foo data/>;
 ><foo data/> : any
 >foo : any
->data : any
+>data : true
 
diff --git a/tests/baselines/reference/reactNamespaceJSXEmit.symbols b/tests/baselines/reference/reactNamespaceJSXEmit.symbols
index 3ca5b91e538d1..55aae09776cf7 100644
--- a/tests/baselines/reference/reactNamespaceJSXEmit.symbols
+++ b/tests/baselines/reference/reactNamespaceJSXEmit.symbols
@@ -14,11 +14,11 @@ declare var x: any;
 
 <foo data/>;
 >foo : Symbol(unknown)
->data : Symbol(unknown)
+>data : Symbol(data, Decl(reactNamespaceJSXEmit.tsx, 6, 4))
 
 <Bar x={x} />;
 >Bar : Symbol(Bar, Decl(reactNamespaceJSXEmit.tsx, 3, 11))
->x : Symbol(unknown)
+>x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 7, 4))
 >x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 4, 11))
 
 <x-component />;
@@ -31,5 +31,5 @@ declare var x: any;
 <Bar { ...x } y={2} />;
 >Bar : Symbol(Bar, Decl(reactNamespaceJSXEmit.tsx, 3, 11))
 >x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 4, 11))
->y : Symbol(unknown)
+>y : Symbol(y, Decl(reactNamespaceJSXEmit.tsx, 10, 13))
 
diff --git a/tests/baselines/reference/reactNamespaceJSXEmit.types b/tests/baselines/reference/reactNamespaceJSXEmit.types
index d2bd88e8fbd0e..0f6fbd6830942 100644
--- a/tests/baselines/reference/reactNamespaceJSXEmit.types
+++ b/tests/baselines/reference/reactNamespaceJSXEmit.types
@@ -15,7 +15,7 @@ declare var x: any;
 <foo data/>;
 ><foo data/> : any
 >foo : any
->data : any
+>data : true
 
 <Bar x={x} />;
 ><Bar x={x} /> : any
@@ -36,6 +36,6 @@ declare var x: any;
 ><Bar { ...x } y={2} /> : any
 >Bar : any
 >x : any
->y : any
+>y : number
 >2 : 2
 
diff --git a/tests/baselines/reference/tsxAttributeErrors.errors.txt b/tests/baselines/reference/tsxAttributeErrors.errors.txt
index 4a89896936363..50dfd88c52702 100644
--- a/tests/baselines/reference/tsxAttributeErrors.errors.txt
+++ b/tests/baselines/reference/tsxAttributeErrors.errors.txt
@@ -1,7 +1,12 @@
-tests/cases/conformance/jsx/tsxAttributeErrors.tsx(15,6): error TS2322: Type '42' is not assignable to type 'string'.
-tests/cases/conformance/jsx/tsxAttributeErrors.tsx(18,6): error TS2322: Type '"foo"' is not assignable to type 'number'.
-tests/cases/conformance/jsx/tsxAttributeErrors.tsx(22,6): error TS2606: Property 'text' of JSX spread attribute is not assignable to target property.
-  Type 'number' is not assignable to type 'string'.
+tests/cases/conformance/jsx/tsxAttributeErrors.tsx(15,6): error TS2322: Type '{ text: 42; }' is not assignable to type '{ text?: string; width?: number; }'.
+  Types of property 'text' are incompatible.
+    Type '42' is not assignable to type 'string'.
+tests/cases/conformance/jsx/tsxAttributeErrors.tsx(18,6): error TS2322: Type '{ width: "foo"; }' is not assignable to type '{ text?: string; width?: number; }'.
+  Types of property 'width' are incompatible.
+    Type '"foo"' is not assignable to type 'number'.
+tests/cases/conformance/jsx/tsxAttributeErrors.tsx(22,6): error TS2322: Type '{ text: number; }' is not assignable to type '{ text?: string; width?: number; }'.
+  Types of property 'text' are incompatible.
+    Type 'number' is not assignable to type 'string'.
 
 
 ==== tests/cases/conformance/jsx/tsxAttributeErrors.tsx (3 errors) ====
@@ -21,19 +26,24 @@ tests/cases/conformance/jsx/tsxAttributeErrors.tsx(22,6): error TS2606: Property
     // Error, number is not assignable to string
     <div text={42} />;
          ~~~~~~~~~
-!!! error TS2322: Type '42' is not assignable to type 'string'.
+!!! error TS2322: Type '{ text: 42; }' is not assignable to type '{ text?: string; width?: number; }'.
+!!! error TS2322:   Types of property 'text' are incompatible.
+!!! error TS2322:     Type '42' is not assignable to type 'string'.
     
     // Error, string is not assignable to number
     <div width={'foo'} />;
          ~~~~~~~~~~~~~
-!!! error TS2322: Type '"foo"' is not assignable to type 'number'.
+!!! error TS2322: Type '{ width: "foo"; }' is not assignable to type '{ text?: string; width?: number; }'.
+!!! error TS2322:   Types of property 'width' are incompatible.
+!!! error TS2322:     Type '"foo"' is not assignable to type 'number'.
     
     // Error, number is not assignable to string
     var attribs = { text: 100 };
     <div {...attribs} />;
          ~~~~~~~~~~~~
-!!! error TS2606: Property 'text' of JSX spread attribute is not assignable to target property.
-!!! error TS2606:   Type 'number' is not assignable to type 'string'.
+!!! error TS2322: Type '{ text: number; }' is not assignable to type '{ text?: string; width?: number; }'.
+!!! error TS2322:   Types of property 'text' are incompatible.
+!!! error TS2322:     Type 'number' is not assignable to type 'string'.
     
     // No errors here
     <span foo='bar' bar={'foo'} />;
diff --git a/tests/baselines/reference/tsxAttributeResolution1.errors.txt b/tests/baselines/reference/tsxAttributeResolution1.errors.txt
index f7fb114f3e0bc..d064f72f85d99 100644
--- a/tests/baselines/reference/tsxAttributeResolution1.errors.txt
+++ b/tests/baselines/reference/tsxAttributeResolution1.errors.txt
@@ -1,10 +1,20 @@
-tests/cases/conformance/jsx/file.tsx(23,8): error TS2322: Type '"0"' is not assignable to type 'number'.
-tests/cases/conformance/jsx/file.tsx(24,8): error TS2339: Property 'y' does not exist on type 'Attribs1'.
-tests/cases/conformance/jsx/file.tsx(25,8): error TS2339: Property 'y' does not exist on type 'Attribs1'.
-tests/cases/conformance/jsx/file.tsx(26,8): error TS2322: Type '"32"' is not assignable to type 'number'.
-tests/cases/conformance/jsx/file.tsx(27,8): error TS2339: Property 'var' does not exist on type 'Attribs1'.
-tests/cases/conformance/jsx/file.tsx(29,1): error TS2324: Property 'reqd' is missing in type '{ reqd: string; }'.
-tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type '10' is not assignable to type 'string'.
+tests/cases/conformance/jsx/file.tsx(23,8): error TS2322: Type '{ x: "0"; }' is not assignable to type 'Attribs1'.
+  Types of property 'x' are incompatible.
+    Type '"0"' is not assignable to type 'number'.
+tests/cases/conformance/jsx/file.tsx(24,8): error TS2322: Type '{ y: 0; }' is not assignable to type 'Attribs1'.
+  Property 'y' does not exist on type 'Attribs1'.
+tests/cases/conformance/jsx/file.tsx(25,8): error TS2322: Type '{ y: "foo"; }' is not assignable to type 'Attribs1'.
+  Property 'y' does not exist on type 'Attribs1'.
+tests/cases/conformance/jsx/file.tsx(26,8): error TS2322: Type '{ x: "32"; }' is not assignable to type 'Attribs1'.
+  Types of property 'x' are incompatible.
+    Type '"32"' is not assignable to type 'number'.
+tests/cases/conformance/jsx/file.tsx(27,8): error TS2322: Type '{ var: "10"; }' is not assignable to type 'Attribs1'.
+  Property 'var' does not exist on type 'Attribs1'.
+tests/cases/conformance/jsx/file.tsx(29,1): error TS2322: Type '{}' is not assignable to type '{ reqd: string; }'.
+  Property 'reqd' is missing in type '{}'.
+tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type '{ reqd: 10; }' is not assignable to type '{ reqd: string; }'.
+  Types of property 'reqd' are incompatible.
+    Type '10' is not assignable to type 'string'.
 
 
 ==== tests/cases/conformance/jsx/file.tsx (7 errors) ====
@@ -32,26 +42,36 @@ tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type '10' is not assig
     // Errors
     <test1 x={'0'} />; // Error, '0' is not number
            ~~~~~~~
-!!! error TS2322: Type '"0"' is not assignable to type 'number'.
+!!! error TS2322: Type '{ x: "0"; }' is not assignable to type 'Attribs1'.
+!!! error TS2322:   Types of property 'x' are incompatible.
+!!! error TS2322:     Type '"0"' is not assignable to type 'number'.
     <test1 y={0} />; // Error, no property "y"
-           ~
-!!! error TS2339: Property 'y' does not exist on type 'Attribs1'.
+           ~~~~~
+!!! error TS2322: Type '{ y: 0; }' is not assignable to type 'Attribs1'.
+!!! error TS2322:   Property 'y' does not exist on type 'Attribs1'.
     <test1 y="foo" />; // Error, no property "y"
-           ~
-!!! error TS2339: Property 'y' does not exist on type 'Attribs1'.
+           ~~~~~~~
+!!! error TS2322: Type '{ y: "foo"; }' is not assignable to type 'Attribs1'.
+!!! error TS2322:   Property 'y' does not exist on type 'Attribs1'.
     <test1 x="32" />; // Error, "32" is not number
            ~~~~~~
-!!! error TS2322: Type '"32"' is not assignable to type 'number'.
+!!! error TS2322: Type '{ x: "32"; }' is not assignable to type 'Attribs1'.
+!!! error TS2322:   Types of property 'x' are incompatible.
+!!! error TS2322:     Type '"32"' is not assignable to type 'number'.
     <test1 var="10" />; // Error, no 'var' property
-           ~~~
-!!! error TS2339: Property 'var' does not exist on type 'Attribs1'.
+           ~~~~~~~~
+!!! error TS2322: Type '{ var: "10"; }' is not assignable to type 'Attribs1'.
+!!! error TS2322:   Property 'var' does not exist on type 'Attribs1'.
     
     <test2 />; // Error, missing reqd
     ~~~~~~~~~
-!!! error TS2324: Property 'reqd' is missing in type '{ reqd: string; }'.
+!!! error TS2322: Type '{}' is not assignable to type '{ reqd: string; }'.
+!!! error TS2322:   Property 'reqd' is missing in type '{}'.
     <test2 reqd={10} />; // Error, reqd is not string
            ~~~~~~~~~
-!!! error TS2322: Type '10' is not assignable to type 'string'.
+!!! error TS2322: Type '{ reqd: 10; }' is not assignable to type '{ reqd: string; }'.
+!!! error TS2322:   Types of property 'reqd' are incompatible.
+!!! error TS2322:     Type '10' is not assignable to type 'string'.
     
     // Should be OK
     <var var='var' />;
diff --git a/tests/baselines/reference/tsxAttributeResolution10.errors.txt b/tests/baselines/reference/tsxAttributeResolution10.errors.txt
index 787eb4b5f0003..dce068dbb769d 100644
--- a/tests/baselines/reference/tsxAttributeResolution10.errors.txt
+++ b/tests/baselines/reference/tsxAttributeResolution10.errors.txt
@@ -1,4 +1,6 @@
-tests/cases/conformance/jsx/file.tsx(11,14): error TS2322: Type '"world"' is not assignable to type 'boolean'.
+tests/cases/conformance/jsx/file.tsx(11,14): error TS2322: Type '{ bar: "world"; }' is not assignable to type '{ [s: string]: boolean; }'.
+  Property 'bar' is incompatible with index signature.
+    Type '"world"' is not assignable to type 'boolean'.
 
 
 ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ====
@@ -25,7 +27,9 @@ tests/cases/conformance/jsx/file.tsx(11,14): error TS2322: Type '"world"' is not
     // Should be an error
     <MyComponent bar='world' />;
                  ~~~~~~~~~~~
-!!! error TS2322: Type '"world"' is not assignable to type 'boolean'.
+!!! error TS2322: Type '{ bar: "world"; }' is not assignable to type '{ [s: string]: boolean; }'.
+!!! error TS2322:   Property 'bar' is incompatible with index signature.
+!!! error TS2322:     Type '"world"' is not assignable to type 'boolean'.
     
     // Should be OK
     <MyComponent bar={true} />;
diff --git a/tests/baselines/reference/tsxAttributeResolution11.errors.txt b/tests/baselines/reference/tsxAttributeResolution11.errors.txt
index b043897d50d0a..a46bf4ba16fe0 100644
--- a/tests/baselines/reference/tsxAttributeResolution11.errors.txt
+++ b/tests/baselines/reference/tsxAttributeResolution11.errors.txt
@@ -1,4 +1,5 @@
-tests/cases/conformance/jsx/file.tsx(11,22): error TS2339: Property 'bar' does not exist on type 'IntrinsicAttributes & { ref?: string; }'.
+tests/cases/conformance/jsx/file.tsx(11,22): error TS2322: Type '{ bar: "world"; }' is not assignable to type 'IntrinsicAttributes & { ref?: string; }'.
+  Property 'bar' does not exist on type 'IntrinsicAttributes & { ref?: string; }'.
 
 
 ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ====
@@ -27,7 +28,8 @@ tests/cases/conformance/jsx/file.tsx(11,22): error TS2339: Property 'bar' does n
     
     // Should be an OK
     var x = <MyComponent bar='world' />;
-                         ~~~
-!!! error TS2339: Property 'bar' does not exist on type 'IntrinsicAttributes & { ref?: string; }'.
+                         ~~~~~~~~~~~
+!!! error TS2322: Type '{ bar: "world"; }' is not assignable to type 'IntrinsicAttributes & { ref?: string; }'.
+!!! error TS2322:   Property 'bar' does not exist on type 'IntrinsicAttributes & { ref?: string; }'.
     
     
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxAttributeResolution12.errors.txt b/tests/baselines/reference/tsxAttributeResolution12.errors.txt
index ecf51a0f3dd48..041776814ca93 100644
--- a/tests/baselines/reference/tsxAttributeResolution12.errors.txt
+++ b/tests/baselines/reference/tsxAttributeResolution12.errors.txt
@@ -1,5 +1,9 @@
-tests/cases/conformance/jsx/file.tsx(26,10): error TS2324: Property 'reqd' is missing in type 'IntrinsicAttributes & { reqd: any; }'.
-tests/cases/conformance/jsx/file.tsx(29,10): error TS2324: Property 'reqd' is missing in type 'IntrinsicAttributes & { reqd: any; }'.
+tests/cases/conformance/jsx/file.tsx(26,10): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { reqd: any; }'.
+  Type '{}' is not assignable to type '{ reqd: any; }'.
+    Property 'reqd' is missing in type '{}'.
+tests/cases/conformance/jsx/file.tsx(29,10): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { reqd: any; }'.
+  Type '{}' is not assignable to type '{ reqd: any; }'.
+    Property 'reqd' is missing in type '{}'.
 
 
 ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ====
@@ -44,11 +48,15 @@ tests/cases/conformance/jsx/file.tsx(29,10): error TS2324: Property 'reqd' is mi
     const T = TestMod.Test;
     var t1 = <T />;
              ~~~~~
-!!! error TS2324: Property 'reqd' is missing in type 'IntrinsicAttributes & { reqd: any; }'.
+!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { reqd: any; }'.
+!!! error TS2322:   Type '{}' is not assignable to type '{ reqd: any; }'.
+!!! error TS2322:     Property 'reqd' is missing in type '{}'.
     
     // Should error
     var t2 = <TestMod.Test />;
              ~~~~~~~~~~~~~~~~
-!!! error TS2324: Property 'reqd' is missing in type 'IntrinsicAttributes & { reqd: any; }'.
+!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { reqd: any; }'.
+!!! error TS2322:   Type '{}' is not assignable to type '{ reqd: any; }'.
+!!! error TS2322:     Property 'reqd' is missing in type '{}'.
     
     
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxAttributeResolution14.errors.txt b/tests/baselines/reference/tsxAttributeResolution14.errors.txt
index 9f4e00747f1e7..79b4a55f10245 100644
--- a/tests/baselines/reference/tsxAttributeResolution14.errors.txt
+++ b/tests/baselines/reference/tsxAttributeResolution14.errors.txt
@@ -1,5 +1,9 @@
-tests/cases/conformance/jsx/file.tsx(14,28): error TS2322: Type '2' is not assignable to type 'string'.
-tests/cases/conformance/jsx/file.tsx(16,28): error TS2322: Type 'true' is not assignable to type 'string | number'.
+tests/cases/conformance/jsx/file.tsx(14,28): error TS2322: Type '{ primaryText: 2; }' is not assignable to type 'IProps'.
+  Types of property 'primaryText' are incompatible.
+    Type '2' is not assignable to type 'string'.
+tests/cases/conformance/jsx/file.tsx(16,28): error TS2322: Type '{ justRandomProp1: true; primaryText: "hello"; }' is not assignable to type 'IProps'.
+  Property 'justRandomProp1' is incompatible with index signature.
+    Type 'true' is not assignable to type 'string | number'.
 
 
 ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ====
@@ -28,11 +32,15 @@ tests/cases/conformance/jsx/file.tsx(16,28): error TS2322: Type 'true' is not as
         <div>
           <VerticalNavMenuItem primaryText={2} />  // error
                                ~~~~~~~~~~~~~~~
-!!! error TS2322: Type '2' is not assignable to type 'string'.
+!!! error TS2322: Type '{ primaryText: 2; }' is not assignable to type 'IProps'.
+!!! error TS2322:   Types of property 'primaryText' are incompatible.
+!!! error TS2322:     Type '2' is not assignable to type 'string'.
           <VerticalNavMenuItem justRandomProp={2} primaryText={"hello"} />  // ok
           <VerticalNavMenuItem justRandomProp1={true} primaryText={"hello"} />  // error
-                               ~~~~~~~~~~~~~~~~~~~~~~
-!!! error TS2322: Type 'true' is not assignable to type 'string | number'.
+                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ justRandomProp1: true; primaryText: "hello"; }' is not assignable to type 'IProps'.
+!!! error TS2322:   Property 'justRandomProp1' is incompatible with index signature.
+!!! error TS2322:     Type 'true' is not assignable to type 'string | number'.
         </div>
       )
     } 
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxAttributeResolution3.errors.txt b/tests/baselines/reference/tsxAttributeResolution3.errors.txt
index ae8ba7a9a5470..dd4ef78652a0b 100644
--- a/tests/baselines/reference/tsxAttributeResolution3.errors.txt
+++ b/tests/baselines/reference/tsxAttributeResolution3.errors.txt
@@ -1,9 +1,13 @@
-tests/cases/conformance/jsx/file.tsx(19,8): error TS2606: Property 'x' of JSX spread attribute is not assignable to target property.
-  Type 'number' is not assignable to type 'string'.
-tests/cases/conformance/jsx/file.tsx(23,1): error TS2324: Property 'x' is missing in type 'Attribs1'.
-tests/cases/conformance/jsx/file.tsx(31,15): error TS2606: Property 'x' of JSX spread attribute is not assignable to target property.
-  Type 'number' is not assignable to type 'string'.
-tests/cases/conformance/jsx/file.tsx(39,8): error TS2322: Type '32' is not assignable to type 'string'.
+tests/cases/conformance/jsx/file.tsx(19,8): error TS2322: Type '{ x: number; }' is not assignable to type 'Attribs1'.
+  Types of property 'x' are incompatible.
+    Type 'number' is not assignable to type 'string'.
+tests/cases/conformance/jsx/file.tsx(23,8): error TS2322: Type '{ y: number; }' is not assignable to type 'Attribs1'.
+  Property 'x' is missing in type '{ y: number; }'.
+tests/cases/conformance/jsx/file.tsx(31,8): error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Attribs1'.
+  Types of property 'x' are incompatible.
+    Type 'number' is not assignable to type 'string'.
+tests/cases/conformance/jsx/file.tsx(35,8): error TS2322: Type '{ x: string; y: number; extra: number; }' is not assignable to type 'Attribs1'.
+  Property 'extra' does not exist on type 'Attribs1'.
 
 
 ==== tests/cases/conformance/jsx/file.tsx (4 errors) ====
@@ -27,14 +31,16 @@ tests/cases/conformance/jsx/file.tsx(39,8): error TS2322: Type '32' is not assig
     var obj2 = { x: 32 };
     <test1 {...obj2} />
            ~~~~~~~~~
-!!! error TS2606: Property 'x' of JSX spread attribute is not assignable to target property.
-!!! error TS2606:   Type 'number' is not assignable to type 'string'.
+!!! error TS2322: Type '{ x: number; }' is not assignable to type 'Attribs1'.
+!!! error TS2322:   Types of property 'x' are incompatible.
+!!! error TS2322:     Type 'number' is not assignable to type 'string'.
     
     // Error, x is missing
     var obj3 = { y: 32 };
     <test1 {...obj3} />
-    ~~~~~~~~~~~~~~~~~~~
-!!! error TS2324: Property 'x' is missing in type 'Attribs1'.
+           ~~~~~~~~~
+!!! error TS2322: Type '{ y: number; }' is not assignable to type 'Attribs1'.
+!!! error TS2322:   Property 'x' is missing in type '{ y: number; }'.
     
     // OK
     var obj4 = { x: 32, y: 32 };
@@ -43,17 +49,19 @@ tests/cases/conformance/jsx/file.tsx(39,8): error TS2322: Type '32' is not assig
     // Error
     var obj5 = { x: 32, y: 32 };
     <test1 x="ok" {...obj5} />
-                  ~~~~~~~~~
-!!! error TS2606: Property 'x' of JSX spread attribute is not assignable to target property.
-!!! error TS2606:   Type 'number' is not assignable to type 'string'.
+           ~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Attribs1'.
+!!! error TS2322:   Types of property 'x' are incompatible.
+!!! error TS2322:     Type 'number' is not assignable to type 'string'.
     
     // OK
     var obj6 = { x: 'ok', y: 32, extra: 100 };
     <test1 {...obj6} />
+           ~~~~~~~~~
+!!! error TS2322: Type '{ x: string; y: number; extra: number; }' is not assignable to type 'Attribs1'.
+!!! error TS2322:   Property 'extra' does not exist on type 'Attribs1'.
     
-    // Error
+    // OK (spread override)
     var obj7 = { x: 'foo' };
     <test1 x={32} {...obj7} />
-           ~~~~~~
-!!! error TS2322: Type '32' is not assignable to type 'string'.
     
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxAttributeResolution3.js b/tests/baselines/reference/tsxAttributeResolution3.js
index 2898a6bc25144..9605002936e21 100644
--- a/tests/baselines/reference/tsxAttributeResolution3.js
+++ b/tests/baselines/reference/tsxAttributeResolution3.js
@@ -35,7 +35,7 @@ var obj5 = { x: 32, y: 32 };
 var obj6 = { x: 'ok', y: 32, extra: 100 };
 <test1 {...obj6} />
 
-// Error
+// OK (spread override)
 var obj7 = { x: 'foo' };
 <test1 x={32} {...obj7} />
 
@@ -59,6 +59,6 @@ var obj5 = { x: 32, y: 32 };
 // OK
 var obj6 = { x: 'ok', y: 32, extra: 100 };
 <test1 {...obj6}/>;
-// Error
+// OK (spread override)
 var obj7 = { x: 'foo' };
 <test1 x={32} {...obj7}/>;
diff --git a/tests/baselines/reference/tsxAttributeResolution5.errors.txt b/tests/baselines/reference/tsxAttributeResolution5.errors.txt
index 42dabc741ab92..ffbd41a07b25a 100644
--- a/tests/baselines/reference/tsxAttributeResolution5.errors.txt
+++ b/tests/baselines/reference/tsxAttributeResolution5.errors.txt
@@ -1,8 +1,8 @@
-tests/cases/conformance/jsx/file.tsx(21,16): error TS2606: Property 'x' of JSX spread attribute is not assignable to target property.
-  Type 'number' is not assignable to type 'string'.
-tests/cases/conformance/jsx/file.tsx(25,9): error TS2324: Property 'x' is missing in type 'Attribs1'.
-tests/cases/conformance/jsx/file.tsx(29,1): error TS2324: Property 'x' is missing in type 'Attribs1'.
-tests/cases/conformance/jsx/file.tsx(30,1): error TS2324: Property 'toString' is missing in type 'Attribs2'.
+tests/cases/conformance/jsx/file.tsx(17,16): error TS2698: Spread types may only be created from object types.
+tests/cases/conformance/jsx/file.tsx(21,16): error TS2698: Spread types may only be created from object types.
+tests/cases/conformance/jsx/file.tsx(25,16): error TS2698: Spread types may only be created from object types.
+tests/cases/conformance/jsx/file.tsx(29,8): error TS2322: Type '{}' is not assignable to type 'Attribs1'.
+  Property 'x' is missing in type '{}'.
 
 
 ==== tests/cases/conformance/jsx/file.tsx (4 errors) ====
@@ -23,26 +23,26 @@ tests/cases/conformance/jsx/file.tsx(30,1): error TS2324: Property 'toString' is
     
     function make1<T extends {x: string}> (obj: T) {
     	return <test1 {...obj} />; // OK
+    	              ~~~~~~~~
+!!! error TS2698: Spread types may only be created from object types.
     }
     
     function make2<T extends {x: number}> (obj: T) {
     	return <test1 {...obj} />; // Error (x is number, not string)
     	              ~~~~~~~~
-!!! error TS2606: Property 'x' of JSX spread attribute is not assignable to target property.
-!!! error TS2606:   Type 'number' is not assignable to type 'string'.
+!!! error TS2698: Spread types may only be created from object types.
     }
     
     function make3<T extends {y: string}> (obj: T) {
     	return <test1 {...obj} />; // Error, missing x
-    	       ~~~~~~~~~~~~~~~~~~
-!!! error TS2324: Property 'x' is missing in type 'Attribs1'.
+    	              ~~~~~~~~
+!!! error TS2698: Spread types may only be created from object types.
     }
     
     
     <test1 {...{}} />; // Error, missing x
-    ~~~~~~~~~~~~~~~~~
-!!! error TS2324: Property 'x' is missing in type 'Attribs1'.
+           ~~~~~~~
+!!! error TS2322: Type '{}' is not assignable to type 'Attribs1'.
+!!! error TS2322:   Property 'x' is missing in type '{}'.
     <test2 {...{}} />; // Error, missing toString
-    ~~~~~~~~~~~~~~~~~
-!!! error TS2324: Property 'toString' is missing in type 'Attribs2'.
     
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxAttributeResolution6.errors.txt b/tests/baselines/reference/tsxAttributeResolution6.errors.txt
index f3a4d512152da..77f1f5bb8df7a 100644
--- a/tests/baselines/reference/tsxAttributeResolution6.errors.txt
+++ b/tests/baselines/reference/tsxAttributeResolution6.errors.txt
@@ -1,6 +1,11 @@
-tests/cases/conformance/jsx/file.tsx(10,8): error TS2322: Type 'boolean' is not assignable to type 'string'.
-tests/cases/conformance/jsx/file.tsx(11,8): error TS2322: Type '"true"' is not assignable to type 'boolean'.
-tests/cases/conformance/jsx/file.tsx(12,1): error TS2324: Property 'n' is missing in type '{ n: boolean; }'.
+tests/cases/conformance/jsx/file.tsx(10,8): error TS2322: Type '{ s: true; }' is not assignable to type '{ n?: boolean; s?: string; }'.
+  Types of property 's' are incompatible.
+    Type 'true' is not assignable to type 'string'.
+tests/cases/conformance/jsx/file.tsx(11,8): error TS2322: Type '{ n: "true"; }' is not assignable to type '{ n?: boolean; s?: string; }'.
+  Types of property 'n' are incompatible.
+    Type '"true"' is not assignable to type 'boolean'.
+tests/cases/conformance/jsx/file.tsx(12,1): error TS2322: Type '{}' is not assignable to type '{ n: boolean; }'.
+  Property 'n' is missing in type '{}'.
 
 
 ==== tests/cases/conformance/jsx/file.tsx (3 errors) ====
@@ -15,13 +20,18 @@ tests/cases/conformance/jsx/file.tsx(12,1): error TS2324: Property 'n' is missin
     // Error
     <test1 s />;
            ~
-!!! error TS2322: Type 'boolean' is not assignable to type 'string'.
+!!! error TS2322: Type '{ s: true; }' is not assignable to type '{ n?: boolean; s?: string; }'.
+!!! error TS2322:   Types of property 's' are incompatible.
+!!! error TS2322:     Type 'true' is not assignable to type 'string'.
     <test1 n='true' />;
            ~~~~~~~~
-!!! error TS2322: Type '"true"' is not assignable to type 'boolean'.
+!!! error TS2322: Type '{ n: "true"; }' is not assignable to type '{ n?: boolean; s?: string; }'.
+!!! error TS2322:   Types of property 'n' are incompatible.
+!!! error TS2322:     Type '"true"' is not assignable to type 'boolean'.
     <test2 />;
     ~~~~~~~~~
-!!! error TS2324: Property 'n' is missing in type '{ n: boolean; }'.
+!!! error TS2322: Type '{}' is not assignable to type '{ n: boolean; }'.
+!!! error TS2322:   Property 'n' is missing in type '{}'.
     
     // OK
     <test1 n />;
diff --git a/tests/baselines/reference/tsxAttributeResolution7.errors.txt b/tests/baselines/reference/tsxAttributeResolution7.errors.txt
index f5af1b48eb2aa..6f379f9dc1e48 100644
--- a/tests/baselines/reference/tsxAttributeResolution7.errors.txt
+++ b/tests/baselines/reference/tsxAttributeResolution7.errors.txt
@@ -1,4 +1,6 @@
-tests/cases/conformance/jsx/file.tsx(9,8): error TS2322: Type '32' is not assignable to type 'string'.
+tests/cases/conformance/jsx/file.tsx(9,8): error TS2322: Type '{ data-foo: 32; }' is not assignable to type '{ "data-foo"?: string; }'.
+  Types of property '"data-foo"' are incompatible.
+    Type '32' is not assignable to type 'string'.
 
 
 ==== tests/cases/conformance/jsx/file.tsx (1 errors) ====
@@ -12,7 +14,9 @@ tests/cases/conformance/jsx/file.tsx(9,8): error TS2322: Type '32' is not assign
     // Error
     <test1 data-foo={32} />;
            ~~~~~~~~~~~~~
-!!! error TS2322: Type '32' is not assignable to type 'string'.
+!!! error TS2322: Type '{ data-foo: 32; }' is not assignable to type '{ "data-foo"?: string; }'.
+!!! error TS2322:   Types of property '"data-foo"' are incompatible.
+!!! error TS2322:     Type '32' is not assignable to type 'string'.
     
     // OK
     <test1 data-foo={'32'} />;
diff --git a/tests/baselines/reference/tsxAttributeResolution9.errors.txt b/tests/baselines/reference/tsxAttributeResolution9.errors.txt
index 73571689b1fa3..670cdd6dfcb47 100644
--- a/tests/baselines/reference/tsxAttributeResolution9.errors.txt
+++ b/tests/baselines/reference/tsxAttributeResolution9.errors.txt
@@ -1,4 +1,6 @@
-tests/cases/conformance/jsx/file.tsx(9,14): error TS2322: Type '0' is not assignable to type 'string'.
+tests/cases/conformance/jsx/file.tsx(9,14): error TS2322: Type '{ foo: 0; }' is not assignable to type '{ foo: string; }'.
+  Types of property 'foo' are incompatible.
+    Type '0' is not assignable to type 'string'.
 
 
 ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ====
@@ -27,5 +29,7 @@ tests/cases/conformance/jsx/file.tsx(9,14): error TS2322: Type '0' is not assign
     <MyComponent foo="bar" />; // ok  
     <MyComponent foo={0} />; // should be an error
                  ~~~~~~~
-!!! error TS2322: Type '0' is not assignable to type 'string'.
+!!! error TS2322: Type '{ foo: 0; }' is not assignable to type '{ foo: string; }'.
+!!! error TS2322:   Types of property 'foo' are incompatible.
+!!! error TS2322:     Type '0' is not assignable to type 'string'.
     
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxDefaultAttributesResolution1.js b/tests/baselines/reference/tsxDefaultAttributesResolution1.js
new file mode 100644
index 0000000000000..1bb12e56e9899
--- /dev/null
+++ b/tests/baselines/reference/tsxDefaultAttributesResolution1.js
@@ -0,0 +1,36 @@
+//// [file.tsx]
+
+import React = require('react');
+
+interface Prop {
+    x: boolean;
+}
+class Poisoned extends React.Component<Prop, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+// OK
+let p = <Poisoned x/>;
+
+//// [file.jsx]
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var React = require("react");
+var Poisoned = (function (_super) {
+    __extends(Poisoned, _super);
+    function Poisoned() {
+        return _super.apply(this, arguments) || this;
+    }
+    Poisoned.prototype.render = function () {
+        return <div>Hello</div>;
+    };
+    return Poisoned;
+}(React.Component));
+// OK
+var p = <Poisoned x/>;
diff --git a/tests/baselines/reference/tsxDefaultAttributesResolution1.symbols b/tests/baselines/reference/tsxDefaultAttributesResolution1.symbols
new file mode 100644
index 0000000000000..a0efe4f9dbe31
--- /dev/null
+++ b/tests/baselines/reference/tsxDefaultAttributesResolution1.symbols
@@ -0,0 +1,33 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+
+interface Prop {
+>Prop : Symbol(Prop, Decl(file.tsx, 1, 32))
+
+    x: boolean;
+>x : Symbol(Prop.x, Decl(file.tsx, 3, 16))
+}
+class Poisoned extends React.Component<Prop, {}> {
+>Poisoned : Symbol(Poisoned, Decl(file.tsx, 5, 1))
+>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>Prop : Symbol(Prop, Decl(file.tsx, 1, 32))
+
+    render() {
+>render : Symbol(Poisoned.render, Decl(file.tsx, 6, 50))
+
+        return <div>Hello</div>;
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
+    }
+}
+
+// OK
+let p = <Poisoned x/>;
+>p : Symbol(p, Decl(file.tsx, 13, 3))
+>Poisoned : Symbol(Poisoned, Decl(file.tsx, 5, 1))
+>x : Symbol(x, Decl(file.tsx, 13, 17))
+
diff --git a/tests/baselines/reference/tsxDefaultAttributesResolution1.types b/tests/baselines/reference/tsxDefaultAttributesResolution1.types
new file mode 100644
index 0000000000000..1734380a55dde
--- /dev/null
+++ b/tests/baselines/reference/tsxDefaultAttributesResolution1.types
@@ -0,0 +1,35 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : typeof React
+
+interface Prop {
+>Prop : Prop
+
+    x: boolean;
+>x : boolean
+}
+class Poisoned extends React.Component<Prop, {}> {
+>Poisoned : Poisoned
+>React.Component : React.Component<Prop, {}>
+>React : typeof React
+>Component : typeof React.Component
+>Prop : Prop
+
+    render() {
+>render : () => JSX.Element
+
+        return <div>Hello</div>;
+><div>Hello</div> : JSX.Element
+>div : any
+>div : any
+    }
+}
+
+// OK
+let p = <Poisoned x/>;
+>p : JSX.Element
+><Poisoned x/> : JSX.Element
+>Poisoned : typeof Poisoned
+>x : true
+
diff --git a/tests/baselines/reference/tsxDefaultAttributesResolution2.js b/tests/baselines/reference/tsxDefaultAttributesResolution2.js
new file mode 100644
index 0000000000000..d94b592d1346e
--- /dev/null
+++ b/tests/baselines/reference/tsxDefaultAttributesResolution2.js
@@ -0,0 +1,36 @@
+//// [file.tsx]
+
+import React = require('react');
+
+interface Prop {
+    x: true;
+}
+class Poisoned extends React.Component<Prop, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+// OK
+let p = <Poisoned x/>;
+
+//// [file.jsx]
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var React = require("react");
+var Poisoned = (function (_super) {
+    __extends(Poisoned, _super);
+    function Poisoned() {
+        return _super.apply(this, arguments) || this;
+    }
+    Poisoned.prototype.render = function () {
+        return <div>Hello</div>;
+    };
+    return Poisoned;
+}(React.Component));
+// OK
+var p = <Poisoned x/>;
diff --git a/tests/baselines/reference/tsxDefaultAttributesResolution2.symbols b/tests/baselines/reference/tsxDefaultAttributesResolution2.symbols
new file mode 100644
index 0000000000000..7bcdc7ccfa20d
--- /dev/null
+++ b/tests/baselines/reference/tsxDefaultAttributesResolution2.symbols
@@ -0,0 +1,33 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+
+interface Prop {
+>Prop : Symbol(Prop, Decl(file.tsx, 1, 32))
+
+    x: true;
+>x : Symbol(Prop.x, Decl(file.tsx, 3, 16))
+}
+class Poisoned extends React.Component<Prop, {}> {
+>Poisoned : Symbol(Poisoned, Decl(file.tsx, 5, 1))
+>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>Prop : Symbol(Prop, Decl(file.tsx, 1, 32))
+
+    render() {
+>render : Symbol(Poisoned.render, Decl(file.tsx, 6, 50))
+
+        return <div>Hello</div>;
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
+    }
+}
+
+// OK
+let p = <Poisoned x/>;
+>p : Symbol(p, Decl(file.tsx, 13, 3))
+>Poisoned : Symbol(Poisoned, Decl(file.tsx, 5, 1))
+>x : Symbol(x, Decl(file.tsx, 13, 17))
+
diff --git a/tests/baselines/reference/tsxDefaultAttributesResolution2.types b/tests/baselines/reference/tsxDefaultAttributesResolution2.types
new file mode 100644
index 0000000000000..ab2bc0c7da6e4
--- /dev/null
+++ b/tests/baselines/reference/tsxDefaultAttributesResolution2.types
@@ -0,0 +1,36 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : typeof React
+
+interface Prop {
+>Prop : Prop
+
+    x: true;
+>x : true
+>true : true
+}
+class Poisoned extends React.Component<Prop, {}> {
+>Poisoned : Poisoned
+>React.Component : React.Component<Prop, {}>
+>React : typeof React
+>Component : typeof React.Component
+>Prop : Prop
+
+    render() {
+>render : () => JSX.Element
+
+        return <div>Hello</div>;
+><div>Hello</div> : JSX.Element
+>div : any
+>div : any
+    }
+}
+
+// OK
+let p = <Poisoned x/>;
+>p : JSX.Element
+><Poisoned x/> : JSX.Element
+>Poisoned : typeof Poisoned
+>x : true
+
diff --git a/tests/baselines/reference/tsxDefaultAttributesResolution3.errors.txt b/tests/baselines/reference/tsxDefaultAttributesResolution3.errors.txt
new file mode 100644
index 0000000000000..bfb780d202407
--- /dev/null
+++ b/tests/baselines/reference/tsxDefaultAttributesResolution3.errors.txt
@@ -0,0 +1,26 @@
+tests/cases/conformance/jsx/file.tsx(14,19): error TS2322: Type '{ x: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & Prop & { children?: ReactNode; }'.
+  Type '{ x: true; }' is not assignable to type 'Prop'.
+    Types of property 'x' are incompatible.
+      Type 'true' is not assignable to type 'false'.
+
+
+==== tests/cases/conformance/jsx/file.tsx (1 errors) ====
+    
+    import React = require('react');
+    
+    interface Prop {
+        x: false;
+    }
+    class Poisoned extends React.Component<Prop, {}> {
+        render() {
+            return <div>Hello</div>;
+        }
+    }
+    
+    // Error
+    let p = <Poisoned x/>;
+                      ~
+!!! error TS2322: Type '{ x: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & Prop & { children?: ReactNode; }'.
+!!! error TS2322:   Type '{ x: true; }' is not assignable to type 'Prop'.
+!!! error TS2322:     Types of property 'x' are incompatible.
+!!! error TS2322:       Type 'true' is not assignable to type 'false'.
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxDefaultAttributesResolution3.js b/tests/baselines/reference/tsxDefaultAttributesResolution3.js
new file mode 100644
index 0000000000000..db518997c57e8
--- /dev/null
+++ b/tests/baselines/reference/tsxDefaultAttributesResolution3.js
@@ -0,0 +1,36 @@
+//// [file.tsx]
+
+import React = require('react');
+
+interface Prop {
+    x: false;
+}
+class Poisoned extends React.Component<Prop, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+// Error
+let p = <Poisoned x/>;
+
+//// [file.jsx]
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var React = require("react");
+var Poisoned = (function (_super) {
+    __extends(Poisoned, _super);
+    function Poisoned() {
+        return _super.apply(this, arguments) || this;
+    }
+    Poisoned.prototype.render = function () {
+        return <div>Hello</div>;
+    };
+    return Poisoned;
+}(React.Component));
+// Error
+var p = <Poisoned x/>;
diff --git a/tests/baselines/reference/tsxElementResolution.symbols b/tests/baselines/reference/tsxElementResolution.symbols
index 729c3fc9f067c..4b3fd175e1961 100644
--- a/tests/baselines/reference/tsxElementResolution.symbols
+++ b/tests/baselines/reference/tsxElementResolution.symbols
@@ -32,7 +32,7 @@ module Dotted {
 var a = <foundFirst  x="hello" />;
 >a : Symbol(a, Decl(tsxElementResolution.tsx, 17, 3))
 >foundFirst : Symbol(JSX.IntrinsicElements.foundFirst, Decl(tsxElementResolution.tsx, 2, 30))
->x : Symbol(x, Decl(tsxElementResolution.tsx, 3, 15))
+>x : Symbol(x, Decl(tsxElementResolution.tsx, 17, 19))
 
 var b = <string_named />;
 >b : Symbol(b, Decl(tsxElementResolution.tsx, 18, 3))
diff --git a/tests/baselines/reference/tsxElementResolution.types b/tests/baselines/reference/tsxElementResolution.types
index a1c2abcef7c5f..891ebc37e5d60 100644
--- a/tests/baselines/reference/tsxElementResolution.types
+++ b/tests/baselines/reference/tsxElementResolution.types
@@ -33,7 +33,7 @@ var a = <foundFirst  x="hello" />;
 >a : any
 ><foundFirst  x="hello" /> : any
 >foundFirst : typeof foundFirst
->x : any
+>x : string
 
 var b = <string_named />;
 >b : any
diff --git a/tests/baselines/reference/tsxElementResolution11.errors.txt b/tests/baselines/reference/tsxElementResolution11.errors.txt
index f6a4913e558e6..f0d5cf1e009a6 100644
--- a/tests/baselines/reference/tsxElementResolution11.errors.txt
+++ b/tests/baselines/reference/tsxElementResolution11.errors.txt
@@ -1,4 +1,5 @@
-tests/cases/conformance/jsx/file.tsx(17,7): error TS2339: Property 'x' does not exist on type '{ q?: number; }'.
+tests/cases/conformance/jsx/file.tsx(17,7): error TS2322: Type '{ x: 10; }' is not assignable to type '{ q?: number; }'.
+  Property 'x' does not exist on type '{ q?: number; }'.
 
 
 ==== tests/cases/conformance/jsx/file.tsx (1 errors) ====
@@ -19,8 +20,9 @@ tests/cases/conformance/jsx/file.tsx(17,7): error TS2339: Property 'x' does not
     }
     var Obj2: Obj2type;
     <Obj2 x={10} />; // Error
-          ~
-!!! error TS2339: Property 'x' does not exist on type '{ q?: number; }'.
+          ~~~~~~
+!!! error TS2322: Type '{ x: 10; }' is not assignable to type '{ q?: number; }'.
+!!! error TS2322:   Property 'x' does not exist on type '{ q?: number; }'.
     
     interface Obj3type {
     	new(n: string): { x: number; };
diff --git a/tests/baselines/reference/tsxElementResolution12.errors.txt b/tests/baselines/reference/tsxElementResolution12.errors.txt
index 5367e29e388bd..5c4c9baf9cd15 100644
--- a/tests/baselines/reference/tsxElementResolution12.errors.txt
+++ b/tests/baselines/reference/tsxElementResolution12.errors.txt
@@ -1,9 +1,10 @@
-tests/cases/conformance/jsx/file.tsx(17,2): error TS2304: Cannot find name 'Obj2'.
 tests/cases/conformance/jsx/file.tsx(23,1): error TS2607: JSX element class does not support attributes because it does not have a 'pr' property
-tests/cases/conformance/jsx/file.tsx(30,7): error TS2322: Type '"10"' is not assignable to type 'number'.
+tests/cases/conformance/jsx/file.tsx(30,7): error TS2322: Type '{ x: "10"; }' is not assignable to type '{ x: number; }'.
+  Types of property 'x' are incompatible.
+    Type '"10"' is not assignable to type 'number'.
 
 
-==== tests/cases/conformance/jsx/file.tsx (3 errors) ====
+==== tests/cases/conformance/jsx/file.tsx (2 errors) ====
     declare module JSX {
     	interface Element { }
     	interface ElementAttributesProperty { pr: any; }
@@ -19,10 +20,8 @@ tests/cases/conformance/jsx/file.tsx(30,7): error TS2322: Type '"10"' is not ass
     interface Obj2type {
     	new(n: string): { q?: number; pr: any };
     }
-    var obj2: Obj2type;
+    var Obj2: Obj2type;
     <Obj2 x={10} />; // OK
-     ~~~~
-!!! error TS2304: Cannot find name 'Obj2'.
     
     interface Obj3type {
     	new(n: string): { x: number; };
@@ -39,5 +38,7 @@ tests/cases/conformance/jsx/file.tsx(30,7): error TS2322: Type '"10"' is not ass
     <Obj4 x={10} />; // OK
     <Obj4 x={'10'} />; // Error
           ~~~~~~~~
-!!! error TS2322: Type '"10"' is not assignable to type 'number'.
+!!! error TS2322: Type '{ x: "10"; }' is not assignable to type '{ x: number; }'.
+!!! error TS2322:   Types of property 'x' are incompatible.
+!!! error TS2322:     Type '"10"' is not assignable to type 'number'.
     
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxElementResolution12.js b/tests/baselines/reference/tsxElementResolution12.js
index b4dd94ef0eb8b..b01266aa78984 100644
--- a/tests/baselines/reference/tsxElementResolution12.js
+++ b/tests/baselines/reference/tsxElementResolution12.js
@@ -14,7 +14,7 @@ var Obj1: Obj1type;
 interface Obj2type {
 	new(n: string): { q?: number; pr: any };
 }
-var obj2: Obj2type;
+var Obj2: Obj2type;
 <Obj2 x={10} />; // OK
 
 interface Obj3type {
@@ -34,7 +34,7 @@ var Obj4: Obj4type;
 //// [file.jsx]
 var Obj1;
 <Obj1 x={10}/>; // OK
-var obj2;
+var Obj2;
 <Obj2 x={10}/>; // OK
 var Obj3;
 <Obj3 x={10}/>; // Error
diff --git a/tests/baselines/reference/tsxElementResolution13.symbols b/tests/baselines/reference/tsxElementResolution13.symbols
index 9122f553a88d3..e306faeaaf261 100644
--- a/tests/baselines/reference/tsxElementResolution13.symbols
+++ b/tests/baselines/reference/tsxElementResolution13.symbols
@@ -23,5 +23,5 @@ var obj1: Obj1;
 
 <obj1 x={10} />; // Error
 >obj1 : Symbol(unknown)
->x : Symbol(unknown)
+>x : Symbol(x, Decl(file.tsx, 9, 5))
 
diff --git a/tests/baselines/reference/tsxElementResolution13.types b/tests/baselines/reference/tsxElementResolution13.types
index d55d4705ff419..b2a6e54633ab4 100644
--- a/tests/baselines/reference/tsxElementResolution13.types
+++ b/tests/baselines/reference/tsxElementResolution13.types
@@ -24,6 +24,6 @@ var obj1: Obj1;
 <obj1 x={10} />; // Error
 ><obj1 x={10} /> : JSX.Element
 >obj1 : Obj1
->x : any
+>x : number
 >10 : 10
 
diff --git a/tests/baselines/reference/tsxElementResolution14.symbols b/tests/baselines/reference/tsxElementResolution14.symbols
index a605606b1ed50..e1a17239e85be 100644
--- a/tests/baselines/reference/tsxElementResolution14.symbols
+++ b/tests/baselines/reference/tsxElementResolution14.symbols
@@ -18,5 +18,5 @@ var obj1: Obj1;
 
 <obj1 x={10} />; // OK
 >obj1 : Symbol(unknown)
->x : Symbol(unknown)
+>x : Symbol(x, Decl(file.tsx, 8, 5))
 
diff --git a/tests/baselines/reference/tsxElementResolution14.types b/tests/baselines/reference/tsxElementResolution14.types
index 752a0baafb996..a6e8cc5283475 100644
--- a/tests/baselines/reference/tsxElementResolution14.types
+++ b/tests/baselines/reference/tsxElementResolution14.types
@@ -19,6 +19,6 @@ var obj1: Obj1;
 <obj1 x={10} />; // OK
 ><obj1 x={10} /> : JSX.Element
 >obj1 : Obj1
->x : any
+>x : number
 >10 : 10
 
diff --git a/tests/baselines/reference/tsxElementResolution3.errors.txt b/tests/baselines/reference/tsxElementResolution3.errors.txt
index 1b8b6c5834c15..d869821a4cbd9 100644
--- a/tests/baselines/reference/tsxElementResolution3.errors.txt
+++ b/tests/baselines/reference/tsxElementResolution3.errors.txt
@@ -1,8 +1,8 @@
-tests/cases/conformance/jsx/file.tsx(12,1): error TS2324: Property 'n' is missing in type '{ n: string; }'.
-tests/cases/conformance/jsx/file.tsx(12,7): error TS2339: Property 'w' does not exist on type '{ n: string; }'.
+tests/cases/conformance/jsx/file.tsx(12,7): error TS2322: Type '{ w: "err"; }' is not assignable to type '{ n: string; }'.
+  Property 'w' does not exist on type '{ n: string; }'.
 
 
-==== tests/cases/conformance/jsx/file.tsx (2 errors) ====
+==== tests/cases/conformance/jsx/file.tsx (1 errors) ====
     declare module JSX {
     	interface Element { }
     	interface IntrinsicElements {
@@ -15,7 +15,6 @@ tests/cases/conformance/jsx/file.tsx(12,7): error TS2339: Property 'w' does not
     
     // Error
     <span w='err' />;
-    ~~~~~~~~~~~~~~~~
-!!! error TS2324: Property 'n' is missing in type '{ n: string; }'.
-          ~
-!!! error TS2339: Property 'w' does not exist on type '{ n: string; }'.
\ No newline at end of file
+          ~~~~~~~
+!!! error TS2322: Type '{ w: "err"; }' is not assignable to type '{ n: string; }'.
+!!! error TS2322:   Property 'w' does not exist on type '{ n: string; }'.
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxElementResolution4.errors.txt b/tests/baselines/reference/tsxElementResolution4.errors.txt
index e6dd599defc8d..b5d5437d87220 100644
--- a/tests/baselines/reference/tsxElementResolution4.errors.txt
+++ b/tests/baselines/reference/tsxElementResolution4.errors.txt
@@ -1,8 +1,8 @@
-tests/cases/conformance/jsx/file.tsx(16,1): error TS2324: Property 'm' is missing in type '{ m: string; }'.
-tests/cases/conformance/jsx/file.tsx(16,7): error TS2339: Property 'q' does not exist on type '{ m: string; }'.
+tests/cases/conformance/jsx/file.tsx(16,7): error TS2322: Type '{ q: ""; }' is not assignable to type '{ m: string; }'.
+  Property 'q' does not exist on type '{ m: string; }'.
 
 
-==== tests/cases/conformance/jsx/file.tsx (2 errors) ====
+==== tests/cases/conformance/jsx/file.tsx (1 errors) ====
     declare module JSX {
     	interface Element { }
     	interface IntrinsicElements {
@@ -19,8 +19,7 @@ tests/cases/conformance/jsx/file.tsx(16,7): error TS2339: Property 'q' does not
     
     // Error
     <span q='' />;
-    ~~~~~~~~~~~~~
-!!! error TS2324: Property 'm' is missing in type '{ m: string; }'.
-          ~
-!!! error TS2339: Property 'q' does not exist on type '{ m: string; }'.
+          ~~~~
+!!! error TS2322: Type '{ q: ""; }' is not assignable to type '{ m: string; }'.
+!!! error TS2322:   Property 'q' does not exist on type '{ m: string; }'.
     
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxElementResolution5.symbols b/tests/baselines/reference/tsxElementResolution5.symbols
index e0fc11470837e..a788a51fc65e8 100644
--- a/tests/baselines/reference/tsxElementResolution5.symbols
+++ b/tests/baselines/reference/tsxElementResolution5.symbols
@@ -9,5 +9,5 @@ declare module JSX {
 // OK, but implicit any
 <div n='x' />;
 >div : Symbol(unknown)
->n : Symbol(unknown)
+>n : Symbol(n, Decl(file1.tsx, 5, 4))
 
diff --git a/tests/baselines/reference/tsxElementResolution5.types b/tests/baselines/reference/tsxElementResolution5.types
index cdfb91c706728..cd2f3d2633784 100644
--- a/tests/baselines/reference/tsxElementResolution5.types
+++ b/tests/baselines/reference/tsxElementResolution5.types
@@ -10,5 +10,5 @@ declare module JSX {
 <div n='x' />;
 ><div n='x' /> : JSX.Element
 >div : any
->n : any
+>n : string
 
diff --git a/tests/baselines/reference/tsxElementResolution9.symbols b/tests/baselines/reference/tsxElementResolution9.symbols
index d6b0da12e6f37..30193ebb82d7b 100644
--- a/tests/baselines/reference/tsxElementResolution9.symbols
+++ b/tests/baselines/reference/tsxElementResolution9.symbols
@@ -64,5 +64,5 @@ var Obj3: Obj3;
 
 <Obj3 x={42} />; // OK
 >Obj3 : Symbol(Obj3, Decl(file.tsx, 17, 9), Decl(file.tsx, 23, 3))
->x : Symbol(unknown)
+>x : Symbol(x, Decl(file.tsx, 24, 5))
 
diff --git a/tests/baselines/reference/tsxElementResolution9.types b/tests/baselines/reference/tsxElementResolution9.types
index c63e61efc0716..4d9fb4e73e9fa 100644
--- a/tests/baselines/reference/tsxElementResolution9.types
+++ b/tests/baselines/reference/tsxElementResolution9.types
@@ -67,6 +67,6 @@ var Obj3: Obj3;
 <Obj3 x={42} />; // OK
 ><Obj3 x={42} /> : JSX.Element
 >Obj3 : Obj3
->x : any
+>x : number
 >42 : 42
 
diff --git a/tests/baselines/reference/tsxEmit1.symbols b/tests/baselines/reference/tsxEmit1.symbols
index 9e32354b1844c..f86c40d2c0752 100644
--- a/tests/baselines/reference/tsxEmit1.symbols
+++ b/tests/baselines/reference/tsxEmit1.symbols
@@ -23,37 +23,37 @@ var selfClosed1 = <div />;
 var selfClosed2 = <div x="1" />;
 >selfClosed2 : Symbol(selfClosed2, Decl(file.tsx, 9, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->x : Symbol(unknown)
+>x : Symbol(x, Decl(file.tsx, 9, 22))
 
 var selfClosed3 = <div x='1' />;
 >selfClosed3 : Symbol(selfClosed3, Decl(file.tsx, 10, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->x : Symbol(unknown)
+>x : Symbol(x, Decl(file.tsx, 10, 22))
 
 var selfClosed4 = <div x="1" y='0' />;
 >selfClosed4 : Symbol(selfClosed4, Decl(file.tsx, 11, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->x : Symbol(unknown)
->y : Symbol(unknown)
+>x : Symbol(x, Decl(file.tsx, 11, 22))
+>y : Symbol(y, Decl(file.tsx, 11, 28))
 
 var selfClosed5 = <div x={0} y='0' />;
 >selfClosed5 : Symbol(selfClosed5, Decl(file.tsx, 12, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->x : Symbol(unknown)
->y : Symbol(unknown)
+>x : Symbol(x, Decl(file.tsx, 12, 22))
+>y : Symbol(y, Decl(file.tsx, 12, 28))
 
 var selfClosed6 = <div x={"1"} y='0' />;
 >selfClosed6 : Symbol(selfClosed6, Decl(file.tsx, 13, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->x : Symbol(unknown)
->y : Symbol(unknown)
+>x : Symbol(x, Decl(file.tsx, 13, 22))
+>y : Symbol(y, Decl(file.tsx, 13, 30))
 
 var selfClosed7 = <div x={p} y='p' />;
 >selfClosed7 : Symbol(selfClosed7, Decl(file.tsx, 14, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->x : Symbol(unknown)
+>x : Symbol(x, Decl(file.tsx, 14, 22))
 >p : Symbol(p, Decl(file.tsx, 7, 3))
->y : Symbol(unknown)
+>y : Symbol(y, Decl(file.tsx, 14, 28))
 
 var openClosed1 = <div></div>;
 >openClosed1 : Symbol(openClosed1, Decl(file.tsx, 16, 3))
@@ -63,20 +63,20 @@ var openClosed1 = <div></div>;
 var openClosed2 = <div n='m'>foo</div>;
 >openClosed2 : Symbol(openClosed2, Decl(file.tsx, 17, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->n : Symbol(unknown)
+>n : Symbol(n, Decl(file.tsx, 17, 22))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
 var openClosed3 = <div n='m'>{p}</div>;
 >openClosed3 : Symbol(openClosed3, Decl(file.tsx, 18, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->n : Symbol(unknown)
+>n : Symbol(n, Decl(file.tsx, 18, 22))
 >p : Symbol(p, Decl(file.tsx, 7, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
 var openClosed4 = <div n='m'>{p < p}</div>;
 >openClosed4 : Symbol(openClosed4, Decl(file.tsx, 19, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->n : Symbol(unknown)
+>n : Symbol(n, Decl(file.tsx, 19, 22))
 >p : Symbol(p, Decl(file.tsx, 7, 3))
 >p : Symbol(p, Decl(file.tsx, 7, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
@@ -84,7 +84,7 @@ var openClosed4 = <div n='m'>{p < p}</div>;
 var openClosed5 = <div n='m'>{p > p}</div>;
 >openClosed5 : Symbol(openClosed5, Decl(file.tsx, 20, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->n : Symbol(unknown)
+>n : Symbol(n, Decl(file.tsx, 20, 22))
 >p : Symbol(p, Decl(file.tsx, 7, 3))
 >p : Symbol(p, Decl(file.tsx, 7, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
@@ -118,14 +118,14 @@ class SomeClass {
 		var rewrites4 = <div a={() => this}></div>;
 >rewrites4 : Symbol(rewrites4, Decl(file.tsx, 28, 5))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->a : Symbol(unknown)
+>a : Symbol(a, Decl(file.tsx, 28, 22))
 >this : Symbol(SomeClass, Decl(file.tsx, 20, 43))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
 		var rewrites5 = <div a={[p, ...p, p]}></div>;
 >rewrites5 : Symbol(rewrites5, Decl(file.tsx, 29, 5))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->a : Symbol(unknown)
+>a : Symbol(a, Decl(file.tsx, 29, 22))
 >p : Symbol(p, Decl(file.tsx, 7, 3))
 >p : Symbol(p, Decl(file.tsx, 7, 3))
 >p : Symbol(p, Decl(file.tsx, 7, 3))
@@ -134,7 +134,7 @@ class SomeClass {
 		var rewrites6 = <div a={{p}}></div>;
 >rewrites6 : Symbol(rewrites6, Decl(file.tsx, 30, 5))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->a : Symbol(unknown)
+>a : Symbol(a, Decl(file.tsx, 30, 22))
 >p : Symbol(p, Decl(file.tsx, 30, 27))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 	}
diff --git a/tests/baselines/reference/tsxEmit1.types b/tests/baselines/reference/tsxEmit1.types
index c3ca7a2b1b015..e6b19a535a455 100644
--- a/tests/baselines/reference/tsxEmit1.types
+++ b/tests/baselines/reference/tsxEmit1.types
@@ -25,44 +25,44 @@ var selfClosed2 = <div x="1" />;
 >selfClosed2 : JSX.Element
 ><div x="1" /> : JSX.Element
 >div : any
->x : any
+>x : string
 
 var selfClosed3 = <div x='1' />;
 >selfClosed3 : JSX.Element
 ><div x='1' /> : JSX.Element
 >div : any
->x : any
+>x : string
 
 var selfClosed4 = <div x="1" y='0' />;
 >selfClosed4 : JSX.Element
 ><div x="1" y='0' /> : JSX.Element
 >div : any
->x : any
->y : any
+>x : string
+>y : string
 
 var selfClosed5 = <div x={0} y='0' />;
 >selfClosed5 : JSX.Element
 ><div x={0} y='0' /> : JSX.Element
 >div : any
->x : any
+>x : number
 >0 : 0
->y : any
+>y : string
 
 var selfClosed6 = <div x={"1"} y='0' />;
 >selfClosed6 : JSX.Element
 ><div x={"1"} y='0' /> : JSX.Element
 >div : any
->x : any
+>x : string
 >"1" : "1"
->y : any
+>y : string
 
 var selfClosed7 = <div x={p} y='p' />;
 >selfClosed7 : JSX.Element
 ><div x={p} y='p' /> : JSX.Element
 >div : any
->x : any
+>x : undefined
 >p : undefined
->y : any
+>y : string
 
 var openClosed1 = <div></div>;
 >openClosed1 : JSX.Element
@@ -74,14 +74,14 @@ var openClosed2 = <div n='m'>foo</div>;
 >openClosed2 : JSX.Element
 ><div n='m'>foo</div> : JSX.Element
 >div : any
->n : any
+>n : string
 >div : any
 
 var openClosed3 = <div n='m'>{p}</div>;
 >openClosed3 : JSX.Element
 ><div n='m'>{p}</div> : JSX.Element
 >div : any
->n : any
+>n : string
 >p : undefined
 >div : any
 
@@ -89,7 +89,7 @@ var openClosed4 = <div n='m'>{p < p}</div>;
 >openClosed4 : JSX.Element
 ><div n='m'>{p < p}</div> : JSX.Element
 >div : any
->n : any
+>n : string
 >p < p : boolean
 >p : undefined
 >p : undefined
@@ -99,7 +99,7 @@ var openClosed5 = <div n='m'>{p > p}</div>;
 >openClosed5 : JSX.Element
 ><div n='m'>{p > p}</div> : JSX.Element
 >div : any
->n : any
+>n : string
 >p > p : boolean
 >p : undefined
 >p : undefined
@@ -142,7 +142,7 @@ class SomeClass {
 >rewrites4 : JSX.Element
 ><div a={() => this}></div> : JSX.Element
 >div : any
->a : any
+>a : () => this
 >() => this : () => this
 >this : this
 >div : any
@@ -151,7 +151,7 @@ class SomeClass {
 >rewrites5 : JSX.Element
 ><div a={[p, ...p, p]}></div> : JSX.Element
 >div : any
->a : any
+>a : any[]
 >[p, ...p, p] : any[]
 >p : any
 >...p : any
@@ -163,7 +163,7 @@ class SomeClass {
 >rewrites6 : JSX.Element
 ><div a={{p}}></div> : JSX.Element
 >div : any
->a : any
+>a : { p: any; }
 >{p} : { p: any; }
 >p : any
 >div : any
diff --git a/tests/baselines/reference/tsxEmit2.js b/tests/baselines/reference/tsxEmit2.js
index 66b1494e8256b..d22f5bab9f1c4 100644
--- a/tests/baselines/reference/tsxEmit2.js
+++ b/tests/baselines/reference/tsxEmit2.js
@@ -6,7 +6,7 @@ declare module JSX {
 	}
 }
 
-var p1, p2, p3;
+var p1: any, p2: any, p3: any;
 var spreads1 = <div {...p1}>{p2}</div>;
 var spreads2 = <div {...p1}>{p2}</div>;
 var spreads3 = <div x={p3} {...p1}>{p2}</div>;
diff --git a/tests/baselines/reference/tsxEmit2.symbols b/tests/baselines/reference/tsxEmit2.symbols
index 13e45e454f176..40b778253e960 100644
--- a/tests/baselines/reference/tsxEmit2.symbols
+++ b/tests/baselines/reference/tsxEmit2.symbols
@@ -13,51 +13,51 @@ declare module JSX {
 	}
 }
 
-var p1, p2, p3;
+var p1: any, p2: any, p3: any;
 >p1 : Symbol(p1, Decl(file.tsx, 7, 3))
->p2 : Symbol(p2, Decl(file.tsx, 7, 7))
->p3 : Symbol(p3, Decl(file.tsx, 7, 11))
+>p2 : Symbol(p2, Decl(file.tsx, 7, 12))
+>p3 : Symbol(p3, Decl(file.tsx, 7, 21))
 
 var spreads1 = <div {...p1}>{p2}</div>;
 >spreads1 : Symbol(spreads1, Decl(file.tsx, 8, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 >p1 : Symbol(p1, Decl(file.tsx, 7, 3))
->p2 : Symbol(p2, Decl(file.tsx, 7, 7))
+>p2 : Symbol(p2, Decl(file.tsx, 7, 12))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
 var spreads2 = <div {...p1}>{p2}</div>;
 >spreads2 : Symbol(spreads2, Decl(file.tsx, 9, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 >p1 : Symbol(p1, Decl(file.tsx, 7, 3))
->p2 : Symbol(p2, Decl(file.tsx, 7, 7))
+>p2 : Symbol(p2, Decl(file.tsx, 7, 12))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
 var spreads3 = <div x={p3} {...p1}>{p2}</div>;
 >spreads3 : Symbol(spreads3, Decl(file.tsx, 10, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->x : Symbol(unknown)
->p3 : Symbol(p3, Decl(file.tsx, 7, 11))
+>x : Symbol(x, Decl(file.tsx, 10, 19))
+>p3 : Symbol(p3, Decl(file.tsx, 7, 21))
 >p1 : Symbol(p1, Decl(file.tsx, 7, 3))
->p2 : Symbol(p2, Decl(file.tsx, 7, 7))
+>p2 : Symbol(p2, Decl(file.tsx, 7, 12))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
 var spreads4 = <div {...p1} x={p3} >{p2}</div>;
 >spreads4 : Symbol(spreads4, Decl(file.tsx, 11, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 >p1 : Symbol(p1, Decl(file.tsx, 7, 3))
->x : Symbol(unknown)
->p3 : Symbol(p3, Decl(file.tsx, 7, 11))
->p2 : Symbol(p2, Decl(file.tsx, 7, 7))
+>x : Symbol(x, Decl(file.tsx, 11, 27))
+>p3 : Symbol(p3, Decl(file.tsx, 7, 21))
+>p2 : Symbol(p2, Decl(file.tsx, 7, 12))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
 var spreads5 = <div x={p2} {...p1} y={p3}>{p2}</div>;
 >spreads5 : Symbol(spreads5, Decl(file.tsx, 12, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->x : Symbol(unknown)
->p2 : Symbol(p2, Decl(file.tsx, 7, 7))
+>x : Symbol(x, Decl(file.tsx, 12, 19))
+>p2 : Symbol(p2, Decl(file.tsx, 7, 12))
 >p1 : Symbol(p1, Decl(file.tsx, 7, 3))
->y : Symbol(unknown)
->p3 : Symbol(p3, Decl(file.tsx, 7, 11))
->p2 : Symbol(p2, Decl(file.tsx, 7, 7))
+>y : Symbol(y, Decl(file.tsx, 12, 34))
+>p3 : Symbol(p3, Decl(file.tsx, 7, 21))
+>p2 : Symbol(p2, Decl(file.tsx, 7, 12))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
diff --git a/tests/baselines/reference/tsxEmit2.types b/tests/baselines/reference/tsxEmit2.types
index d306dc9ffe057..e02dc6c7f8620 100644
--- a/tests/baselines/reference/tsxEmit2.types
+++ b/tests/baselines/reference/tsxEmit2.types
@@ -13,7 +13,7 @@ declare module JSX {
 	}
 }
 
-var p1, p2, p3;
+var p1: any, p2: any, p3: any;
 >p1 : any
 >p2 : any
 >p3 : any
@@ -22,16 +22,16 @@ var spreads1 = <div {...p1}>{p2}</div>;
 >spreads1 : JSX.Element
 ><div {...p1}>{p2}</div> : JSX.Element
 >div : any
->p1 : undefined
->p2 : undefined
+>p1 : any
+>p2 : any
 >div : any
 
 var spreads2 = <div {...p1}>{p2}</div>;
 >spreads2 : JSX.Element
 ><div {...p1}>{p2}</div> : JSX.Element
 >div : any
->p1 : undefined
->p2 : undefined
+>p1 : any
+>p2 : any
 >div : any
 
 var spreads3 = <div x={p3} {...p1}>{p2}</div>;
@@ -39,19 +39,19 @@ var spreads3 = <div x={p3} {...p1}>{p2}</div>;
 ><div x={p3} {...p1}>{p2}</div> : JSX.Element
 >div : any
 >x : any
->p3 : undefined
->p1 : undefined
->p2 : undefined
+>p3 : any
+>p1 : any
+>p2 : any
 >div : any
 
 var spreads4 = <div {...p1} x={p3} >{p2}</div>;
 >spreads4 : JSX.Element
 ><div {...p1} x={p3} >{p2}</div> : JSX.Element
 >div : any
->p1 : undefined
+>p1 : any
 >x : any
->p3 : undefined
->p2 : undefined
+>p3 : any
+>p2 : any
 >div : any
 
 var spreads5 = <div x={p2} {...p1} y={p3}>{p2}</div>;
@@ -59,10 +59,10 @@ var spreads5 = <div x={p2} {...p1} y={p3}>{p2}</div>;
 ><div x={p2} {...p1} y={p3}>{p2}</div> : JSX.Element
 >div : any
 >x : any
->p2 : undefined
->p1 : undefined
+>p2 : any
+>p1 : any
 >y : any
->p3 : undefined
->p2 : undefined
+>p3 : any
+>p2 : any
 >div : any
 
diff --git a/tests/baselines/reference/tsxExternalModuleEmit2.symbols b/tests/baselines/reference/tsxExternalModuleEmit2.symbols
index ff5fdc4917137..8f7cfa521361c 100644
--- a/tests/baselines/reference/tsxExternalModuleEmit2.symbols
+++ b/tests/baselines/reference/tsxExternalModuleEmit2.symbols
@@ -19,7 +19,7 @@ declare var Foo, React;
 // Should see mod_1['default'] in emit here
 <Foo handler={Main}></Foo>;
 >Foo : Symbol(Foo, Decl(app.tsx, 1, 11))
->handler : Symbol(unknown)
+>handler : Symbol(handler, Decl(app.tsx, 3, 4))
 >Main : Symbol(Main, Decl(app.tsx, 0, 6))
 >Foo : Symbol(Foo, Decl(app.tsx, 1, 11))
 
diff --git a/tests/baselines/reference/tsxGenericArrowFunctionParsing.symbols b/tests/baselines/reference/tsxGenericArrowFunctionParsing.symbols
index 2d3c1f18d48d2..8b773c3b5ab79 100644
--- a/tests/baselines/reference/tsxGenericArrowFunctionParsing.symbols
+++ b/tests/baselines/reference/tsxGenericArrowFunctionParsing.symbols
@@ -44,7 +44,7 @@ x3();
 var x4 = <T extends={true}>() => {}</T>;
 >x4 : Symbol(x4, Decl(file.tsx, 19, 3))
 >T : Symbol(T, Decl(file.tsx, 4, 3))
->extends : Symbol(unknown)
+>extends : Symbol(extends, Decl(file.tsx, 19, 11))
 >T : Symbol(T, Decl(file.tsx, 4, 3))
 
 x4.isElement;
@@ -56,7 +56,7 @@ x4.isElement;
 var x5 = <T extends>() => {}</T>;
 >x5 : Symbol(x5, Decl(file.tsx, 23, 3))
 >T : Symbol(T, Decl(file.tsx, 4, 3))
->extends : Symbol(unknown)
+>extends : Symbol(extends, Decl(file.tsx, 23, 11))
 >T : Symbol(T, Decl(file.tsx, 4, 3))
 
 x5.isElement;
diff --git a/tests/baselines/reference/tsxGenericArrowFunctionParsing.types b/tests/baselines/reference/tsxGenericArrowFunctionParsing.types
index 0f746a071363e..0e601daecafa9 100644
--- a/tests/baselines/reference/tsxGenericArrowFunctionParsing.types
+++ b/tests/baselines/reference/tsxGenericArrowFunctionParsing.types
@@ -50,7 +50,7 @@ var x4 = <T extends={true}>() => {}</T>;
 >x4 : JSX.Element
 ><T extends={true}>() => {}</T> : JSX.Element
 >T : any
->extends : any
+>extends : boolean
 >true : true
 >T : any
 
@@ -64,7 +64,7 @@ var x5 = <T extends>() => {}</T>;
 >x5 : JSX.Element
 ><T extends>() => {}</T> : JSX.Element
 >T : any
->extends : any
+>extends : true
 >T : any
 
 x5.isElement;
diff --git a/tests/baselines/reference/tsxInArrowFunction.symbols b/tests/baselines/reference/tsxInArrowFunction.symbols
index ff80428cf7438..9fc928e36e1e4 100644
--- a/tests/baselines/reference/tsxInArrowFunction.symbols
+++ b/tests/baselines/reference/tsxInArrowFunction.symbols
@@ -23,7 +23,7 @@ declare namespace JSX {
 <div>{() => <div text="wat" />}</div>;
 >div : Symbol(JSX.IntrinsicElements.div, Decl(tsxInArrowFunction.tsx, 3, 33))
 >div : Symbol(JSX.IntrinsicElements.div, Decl(tsxInArrowFunction.tsx, 3, 33))
->text : Symbol(text, Decl(tsxInArrowFunction.tsx, 4, 14))
+>text : Symbol(text, Decl(tsxInArrowFunction.tsx, 12, 16))
 >div : Symbol(JSX.IntrinsicElements.div, Decl(tsxInArrowFunction.tsx, 3, 33))
 
 // didn't work
@@ -31,21 +31,21 @@ declare namespace JSX {
 >div : Symbol(JSX.IntrinsicElements.div, Decl(tsxInArrowFunction.tsx, 3, 33))
 >x : Symbol(x, Decl(tsxInArrowFunction.tsx, 15, 6))
 >div : Symbol(JSX.IntrinsicElements.div, Decl(tsxInArrowFunction.tsx, 3, 33))
->text : Symbol(text, Decl(tsxInArrowFunction.tsx, 4, 14))
+>text : Symbol(text, Decl(tsxInArrowFunction.tsx, 15, 15))
 >div : Symbol(JSX.IntrinsicElements.div, Decl(tsxInArrowFunction.tsx, 3, 33))
 
 // worked
 <div>{() => (<div text="wat" />)}</div>;
 >div : Symbol(JSX.IntrinsicElements.div, Decl(tsxInArrowFunction.tsx, 3, 33))
 >div : Symbol(JSX.IntrinsicElements.div, Decl(tsxInArrowFunction.tsx, 3, 33))
->text : Symbol(text, Decl(tsxInArrowFunction.tsx, 4, 14))
+>text : Symbol(text, Decl(tsxInArrowFunction.tsx, 18, 17))
 >div : Symbol(JSX.IntrinsicElements.div, Decl(tsxInArrowFunction.tsx, 3, 33))
 
 // worked (!)
 <div>{() => <div text="wat"></div>}</div>;
 >div : Symbol(JSX.IntrinsicElements.div, Decl(tsxInArrowFunction.tsx, 3, 33))
 >div : Symbol(JSX.IntrinsicElements.div, Decl(tsxInArrowFunction.tsx, 3, 33))
->text : Symbol(text, Decl(tsxInArrowFunction.tsx, 4, 14))
+>text : Symbol(text, Decl(tsxInArrowFunction.tsx, 21, 16))
 >div : Symbol(JSX.IntrinsicElements.div, Decl(tsxInArrowFunction.tsx, 3, 33))
 >div : Symbol(JSX.IntrinsicElements.div, Decl(tsxInArrowFunction.tsx, 3, 33))
 
diff --git a/tests/baselines/reference/tsxInArrowFunction.types b/tests/baselines/reference/tsxInArrowFunction.types
index e4b2aeb50fe2c..76b0d1e1e6482 100644
--- a/tests/baselines/reference/tsxInArrowFunction.types
+++ b/tests/baselines/reference/tsxInArrowFunction.types
@@ -26,7 +26,7 @@ declare namespace JSX {
 >() => <div text="wat" /> : () => JSX.Element
 ><div text="wat" /> : JSX.Element
 >div : any
->text : any
+>text : string
 >div : any
 
 // didn't work
@@ -37,7 +37,7 @@ declare namespace JSX {
 >x : any
 ><div text="wat" /> : JSX.Element
 >div : any
->text : any
+>text : string
 >div : any
 
 // worked
@@ -48,7 +48,7 @@ declare namespace JSX {
 >(<div text="wat" />) : JSX.Element
 ><div text="wat" /> : JSX.Element
 >div : any
->text : any
+>text : string
 >div : any
 
 // worked (!)
@@ -58,7 +58,7 @@ declare namespace JSX {
 >() => <div text="wat"></div> : () => JSX.Element
 ><div text="wat"></div> : JSX.Element
 >div : any
->text : any
+>text : string
 >div : any
 >div : any
 
diff --git a/tests/baselines/reference/tsxReactEmit1.symbols b/tests/baselines/reference/tsxReactEmit1.symbols
index 6887a9550c086..ec4c367b40e69 100644
--- a/tests/baselines/reference/tsxReactEmit1.symbols
+++ b/tests/baselines/reference/tsxReactEmit1.symbols
@@ -25,38 +25,38 @@ var selfClosed1 = <div />;
 var selfClosed2 = <div x="1" />;
 >selfClosed2 : Symbol(selfClosed2, Decl(file.tsx, 10, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->x : Symbol(unknown)
+>x : Symbol(x, Decl(file.tsx, 10, 22))
 
 var selfClosed3 = <div x='1' />;
 >selfClosed3 : Symbol(selfClosed3, Decl(file.tsx, 11, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->x : Symbol(unknown)
+>x : Symbol(x, Decl(file.tsx, 11, 22))
 
 var selfClosed4 = <div x="1" y='0' />;
 >selfClosed4 : Symbol(selfClosed4, Decl(file.tsx, 12, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->x : Symbol(unknown)
->y : Symbol(unknown)
+>x : Symbol(x, Decl(file.tsx, 12, 22))
+>y : Symbol(y, Decl(file.tsx, 12, 28))
 
 var selfClosed5 = <div x={0} y='0' />;
 >selfClosed5 : Symbol(selfClosed5, Decl(file.tsx, 13, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->x : Symbol(unknown)
->y : Symbol(unknown)
+>x : Symbol(x, Decl(file.tsx, 13, 22))
+>y : Symbol(y, Decl(file.tsx, 13, 28))
 
 var selfClosed6 = <div x={"1"} y='0' />;
 >selfClosed6 : Symbol(selfClosed6, Decl(file.tsx, 14, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->x : Symbol(unknown)
->y : Symbol(unknown)
+>x : Symbol(x, Decl(file.tsx, 14, 22))
+>y : Symbol(y, Decl(file.tsx, 14, 30))
 
 var selfClosed7 = <div x={p} y='p' b />;
 >selfClosed7 : Symbol(selfClosed7, Decl(file.tsx, 15, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->x : Symbol(unknown)
+>x : Symbol(x, Decl(file.tsx, 15, 22))
 >p : Symbol(p, Decl(file.tsx, 8, 3))
->y : Symbol(unknown)
->b : Symbol(unknown)
+>y : Symbol(y, Decl(file.tsx, 15, 28))
+>b : Symbol(b, Decl(file.tsx, 15, 34))
 
 var openClosed1 = <div></div>;
 >openClosed1 : Symbol(openClosed1, Decl(file.tsx, 17, 3))
@@ -66,20 +66,20 @@ var openClosed1 = <div></div>;
 var openClosed2 = <div n='m'>foo</div>;
 >openClosed2 : Symbol(openClosed2, Decl(file.tsx, 18, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->n : Symbol(unknown)
+>n : Symbol(n, Decl(file.tsx, 18, 22))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
 var openClosed3 = <div n='m'>{p}</div>;
 >openClosed3 : Symbol(openClosed3, Decl(file.tsx, 19, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->n : Symbol(unknown)
+>n : Symbol(n, Decl(file.tsx, 19, 22))
 >p : Symbol(p, Decl(file.tsx, 8, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
 var openClosed4 = <div n='m'>{p < p}</div>;
 >openClosed4 : Symbol(openClosed4, Decl(file.tsx, 20, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->n : Symbol(unknown)
+>n : Symbol(n, Decl(file.tsx, 20, 22))
 >p : Symbol(p, Decl(file.tsx, 8, 3))
 >p : Symbol(p, Decl(file.tsx, 8, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
@@ -87,8 +87,8 @@ var openClosed4 = <div n='m'>{p < p}</div>;
 var openClosed5 = <div n='m' b>{p > p}</div>;
 >openClosed5 : Symbol(openClosed5, Decl(file.tsx, 21, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->n : Symbol(unknown)
->b : Symbol(unknown)
+>n : Symbol(n, Decl(file.tsx, 21, 22))
+>b : Symbol(b, Decl(file.tsx, 21, 28))
 >p : Symbol(p, Decl(file.tsx, 8, 3))
 >p : Symbol(p, Decl(file.tsx, 8, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
@@ -122,14 +122,14 @@ class SomeClass {
 		var rewrites4 = <div a={() => this}></div>;
 >rewrites4 : Symbol(rewrites4, Decl(file.tsx, 29, 5))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->a : Symbol(unknown)
+>a : Symbol(a, Decl(file.tsx, 29, 22))
 >this : Symbol(SomeClass, Decl(file.tsx, 21, 45))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
 		var rewrites5 = <div a={[p, ...p, p]}></div>;
 >rewrites5 : Symbol(rewrites5, Decl(file.tsx, 30, 5))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->a : Symbol(unknown)
+>a : Symbol(a, Decl(file.tsx, 30, 22))
 >p : Symbol(p, Decl(file.tsx, 8, 3))
 >p : Symbol(p, Decl(file.tsx, 8, 3))
 >p : Symbol(p, Decl(file.tsx, 8, 3))
@@ -138,7 +138,7 @@ class SomeClass {
 		var rewrites6 = <div a={{p}}></div>;
 >rewrites6 : Symbol(rewrites6, Decl(file.tsx, 31, 5))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->a : Symbol(unknown)
+>a : Symbol(a, Decl(file.tsx, 31, 22))
 >p : Symbol(p, Decl(file.tsx, 31, 27))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 	}
diff --git a/tests/baselines/reference/tsxReactEmit1.types b/tests/baselines/reference/tsxReactEmit1.types
index b2cb2f73eba05..f2b0e9346324a 100644
--- a/tests/baselines/reference/tsxReactEmit1.types
+++ b/tests/baselines/reference/tsxReactEmit1.types
@@ -27,45 +27,45 @@ var selfClosed2 = <div x="1" />;
 >selfClosed2 : JSX.Element
 ><div x="1" /> : JSX.Element
 >div : any
->x : any
+>x : string
 
 var selfClosed3 = <div x='1' />;
 >selfClosed3 : JSX.Element
 ><div x='1' /> : JSX.Element
 >div : any
->x : any
+>x : string
 
 var selfClosed4 = <div x="1" y='0' />;
 >selfClosed4 : JSX.Element
 ><div x="1" y='0' /> : JSX.Element
 >div : any
->x : any
->y : any
+>x : string
+>y : string
 
 var selfClosed5 = <div x={0} y='0' />;
 >selfClosed5 : JSX.Element
 ><div x={0} y='0' /> : JSX.Element
 >div : any
->x : any
+>x : number
 >0 : 0
->y : any
+>y : string
 
 var selfClosed6 = <div x={"1"} y='0' />;
 >selfClosed6 : JSX.Element
 ><div x={"1"} y='0' /> : JSX.Element
 >div : any
->x : any
+>x : string
 >"1" : "1"
->y : any
+>y : string
 
 var selfClosed7 = <div x={p} y='p' b />;
 >selfClosed7 : JSX.Element
 ><div x={p} y='p' b /> : JSX.Element
 >div : any
->x : any
+>x : undefined
 >p : undefined
->y : any
->b : any
+>y : string
+>b : true
 
 var openClosed1 = <div></div>;
 >openClosed1 : JSX.Element
@@ -77,14 +77,14 @@ var openClosed2 = <div n='m'>foo</div>;
 >openClosed2 : JSX.Element
 ><div n='m'>foo</div> : JSX.Element
 >div : any
->n : any
+>n : string
 >div : any
 
 var openClosed3 = <div n='m'>{p}</div>;
 >openClosed3 : JSX.Element
 ><div n='m'>{p}</div> : JSX.Element
 >div : any
->n : any
+>n : string
 >p : undefined
 >div : any
 
@@ -92,7 +92,7 @@ var openClosed4 = <div n='m'>{p < p}</div>;
 >openClosed4 : JSX.Element
 ><div n='m'>{p < p}</div> : JSX.Element
 >div : any
->n : any
+>n : string
 >p < p : boolean
 >p : undefined
 >p : undefined
@@ -102,8 +102,8 @@ var openClosed5 = <div n='m' b>{p > p}</div>;
 >openClosed5 : JSX.Element
 ><div n='m' b>{p > p}</div> : JSX.Element
 >div : any
->n : any
->b : any
+>n : string
+>b : true
 >p > p : boolean
 >p : undefined
 >p : undefined
@@ -146,7 +146,7 @@ class SomeClass {
 >rewrites4 : JSX.Element
 ><div a={() => this}></div> : JSX.Element
 >div : any
->a : any
+>a : () => this
 >() => this : () => this
 >this : this
 >div : any
@@ -155,7 +155,7 @@ class SomeClass {
 >rewrites5 : JSX.Element
 ><div a={[p, ...p, p]}></div> : JSX.Element
 >div : any
->a : any
+>a : any[]
 >[p, ...p, p] : any[]
 >p : any
 >...p : any
@@ -167,7 +167,7 @@ class SomeClass {
 >rewrites6 : JSX.Element
 ><div a={{p}}></div> : JSX.Element
 >div : any
->a : any
+>a : { p: any; }
 >{p} : { p: any; }
 >p : any
 >div : any
diff --git a/tests/baselines/reference/tsxReactEmit2.js b/tests/baselines/reference/tsxReactEmit2.js
index 80e3215e2b6b1..c81c7b2afeae5 100644
--- a/tests/baselines/reference/tsxReactEmit2.js
+++ b/tests/baselines/reference/tsxReactEmit2.js
@@ -7,7 +7,7 @@ declare module JSX {
 }
 declare var React: any;
 
-var p1, p2, p3;
+var p1: any, p2: any, p3: any;
 var spreads1 = <div {...p1}>{p2}</div>;
 var spreads2 = <div {...p1}>{p2}</div>;
 var spreads3 = <div x={p3} {...p1}>{p2}</div>;
diff --git a/tests/baselines/reference/tsxReactEmit2.symbols b/tests/baselines/reference/tsxReactEmit2.symbols
index 68f33a11f091f..28b2c427bd8a4 100644
--- a/tests/baselines/reference/tsxReactEmit2.symbols
+++ b/tests/baselines/reference/tsxReactEmit2.symbols
@@ -15,51 +15,51 @@ declare module JSX {
 declare var React: any;
 >React : Symbol(React, Decl(file.tsx, 6, 11))
 
-var p1, p2, p3;
+var p1: any, p2: any, p3: any;
 >p1 : Symbol(p1, Decl(file.tsx, 8, 3))
->p2 : Symbol(p2, Decl(file.tsx, 8, 7))
->p3 : Symbol(p3, Decl(file.tsx, 8, 11))
+>p2 : Symbol(p2, Decl(file.tsx, 8, 12))
+>p3 : Symbol(p3, Decl(file.tsx, 8, 21))
 
 var spreads1 = <div {...p1}>{p2}</div>;
 >spreads1 : Symbol(spreads1, Decl(file.tsx, 9, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 >p1 : Symbol(p1, Decl(file.tsx, 8, 3))
->p2 : Symbol(p2, Decl(file.tsx, 8, 7))
+>p2 : Symbol(p2, Decl(file.tsx, 8, 12))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
 var spreads2 = <div {...p1}>{p2}</div>;
 >spreads2 : Symbol(spreads2, Decl(file.tsx, 10, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 >p1 : Symbol(p1, Decl(file.tsx, 8, 3))
->p2 : Symbol(p2, Decl(file.tsx, 8, 7))
+>p2 : Symbol(p2, Decl(file.tsx, 8, 12))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
 var spreads3 = <div x={p3} {...p1}>{p2}</div>;
 >spreads3 : Symbol(spreads3, Decl(file.tsx, 11, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->x : Symbol(unknown)
->p3 : Symbol(p3, Decl(file.tsx, 8, 11))
+>x : Symbol(x, Decl(file.tsx, 11, 19))
+>p3 : Symbol(p3, Decl(file.tsx, 8, 21))
 >p1 : Symbol(p1, Decl(file.tsx, 8, 3))
->p2 : Symbol(p2, Decl(file.tsx, 8, 7))
+>p2 : Symbol(p2, Decl(file.tsx, 8, 12))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
 var spreads4 = <div {...p1} x={p3} >{p2}</div>;
 >spreads4 : Symbol(spreads4, Decl(file.tsx, 12, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 >p1 : Symbol(p1, Decl(file.tsx, 8, 3))
->x : Symbol(unknown)
->p3 : Symbol(p3, Decl(file.tsx, 8, 11))
->p2 : Symbol(p2, Decl(file.tsx, 8, 7))
+>x : Symbol(x, Decl(file.tsx, 12, 27))
+>p3 : Symbol(p3, Decl(file.tsx, 8, 21))
+>p2 : Symbol(p2, Decl(file.tsx, 8, 12))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
 var spreads5 = <div x={p2} {...p1} y={p3}>{p2}</div>;
 >spreads5 : Symbol(spreads5, Decl(file.tsx, 13, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->x : Symbol(unknown)
->p2 : Symbol(p2, Decl(file.tsx, 8, 7))
+>x : Symbol(x, Decl(file.tsx, 13, 19))
+>p2 : Symbol(p2, Decl(file.tsx, 8, 12))
 >p1 : Symbol(p1, Decl(file.tsx, 8, 3))
->y : Symbol(unknown)
->p3 : Symbol(p3, Decl(file.tsx, 8, 11))
->p2 : Symbol(p2, Decl(file.tsx, 8, 7))
+>y : Symbol(y, Decl(file.tsx, 13, 34))
+>p3 : Symbol(p3, Decl(file.tsx, 8, 21))
+>p2 : Symbol(p2, Decl(file.tsx, 8, 12))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
diff --git a/tests/baselines/reference/tsxReactEmit2.types b/tests/baselines/reference/tsxReactEmit2.types
index b05764e996fc3..60599eb568f3a 100644
--- a/tests/baselines/reference/tsxReactEmit2.types
+++ b/tests/baselines/reference/tsxReactEmit2.types
@@ -15,7 +15,7 @@ declare module JSX {
 declare var React: any;
 >React : any
 
-var p1, p2, p3;
+var p1: any, p2: any, p3: any;
 >p1 : any
 >p2 : any
 >p3 : any
@@ -24,16 +24,16 @@ var spreads1 = <div {...p1}>{p2}</div>;
 >spreads1 : JSX.Element
 ><div {...p1}>{p2}</div> : JSX.Element
 >div : any
->p1 : undefined
->p2 : undefined
+>p1 : any
+>p2 : any
 >div : any
 
 var spreads2 = <div {...p1}>{p2}</div>;
 >spreads2 : JSX.Element
 ><div {...p1}>{p2}</div> : JSX.Element
 >div : any
->p1 : undefined
->p2 : undefined
+>p1 : any
+>p2 : any
 >div : any
 
 var spreads3 = <div x={p3} {...p1}>{p2}</div>;
@@ -41,19 +41,19 @@ var spreads3 = <div x={p3} {...p1}>{p2}</div>;
 ><div x={p3} {...p1}>{p2}</div> : JSX.Element
 >div : any
 >x : any
->p3 : undefined
->p1 : undefined
->p2 : undefined
+>p3 : any
+>p1 : any
+>p2 : any
 >div : any
 
 var spreads4 = <div {...p1} x={p3} >{p2}</div>;
 >spreads4 : JSX.Element
 ><div {...p1} x={p3} >{p2}</div> : JSX.Element
 >div : any
->p1 : undefined
+>p1 : any
 >x : any
->p3 : undefined
->p2 : undefined
+>p3 : any
+>p2 : any
 >div : any
 
 var spreads5 = <div x={p2} {...p1} y={p3}>{p2}</div>;
@@ -61,10 +61,10 @@ var spreads5 = <div x={p2} {...p1} y={p3}>{p2}</div>;
 ><div x={p2} {...p1} y={p3}>{p2}</div> : JSX.Element
 >div : any
 >x : any
->p2 : undefined
->p1 : undefined
+>p2 : any
+>p1 : any
 >y : any
->p3 : undefined
->p2 : undefined
+>p3 : any
+>p2 : any
 >div : any
 
diff --git a/tests/baselines/reference/tsxReactEmit4.errors.txt b/tests/baselines/reference/tsxReactEmit4.errors.txt
index 23578d4ed91a4..1ac5b6a17b97d 100644
--- a/tests/baselines/reference/tsxReactEmit4.errors.txt
+++ b/tests/baselines/reference/tsxReactEmit4.errors.txt
@@ -10,7 +10,7 @@ tests/cases/conformance/jsx/file.tsx(12,5): error TS2304: Cannot find name 'blah
     }
     declare var React: any;
     
-    var p;
+    var p: any;
     var openClosed1 = <div>
     
        {blah}
diff --git a/tests/baselines/reference/tsxReactEmit4.js b/tests/baselines/reference/tsxReactEmit4.js
index 33c835d1ab22c..a1e790873e88e 100644
--- a/tests/baselines/reference/tsxReactEmit4.js
+++ b/tests/baselines/reference/tsxReactEmit4.js
@@ -7,7 +7,7 @@ declare module JSX {
 }
 declare var React: any;
 
-var p;
+var p: any;
 var openClosed1 = <div>
 
    {blah}
diff --git a/tests/baselines/reference/tsxReactEmit5.js b/tests/baselines/reference/tsxReactEmit5.js
index c3e58d0a0da54..2f180dc3af3e8 100644
--- a/tests/baselines/reference/tsxReactEmit5.js
+++ b/tests/baselines/reference/tsxReactEmit5.js
@@ -16,7 +16,7 @@ export var React;
 import {React} from "./test";
 // Should emit test_1.React.createElement
 //  and React.__spread
-var foo;
+var foo: any;
 var spread1 = <div x='' {...foo} y='' />;
 
 
diff --git a/tests/baselines/reference/tsxReactEmit5.symbols b/tests/baselines/reference/tsxReactEmit5.symbols
index 3e0e17906761d..533652b0d3c5f 100644
--- a/tests/baselines/reference/tsxReactEmit5.symbols
+++ b/tests/baselines/reference/tsxReactEmit5.symbols
@@ -24,13 +24,13 @@ import {React} from "./test";
 
 // Should emit test_1.React.createElement
 //  and React.__spread
-var foo;
+var foo: any;
 >foo : Symbol(foo, Decl(react-consumer.tsx, 3, 3))
 
 var spread1 = <div x='' {...foo} y='' />;
 >spread1 : Symbol(spread1, Decl(react-consumer.tsx, 4, 3))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 2, 22))
->x : Symbol(unknown)
+>x : Symbol(x, Decl(react-consumer.tsx, 4, 18))
 >foo : Symbol(foo, Decl(react-consumer.tsx, 3, 3))
->y : Symbol(unknown)
+>y : Symbol(y, Decl(react-consumer.tsx, 4, 32))
 
diff --git a/tests/baselines/reference/tsxReactEmit5.types b/tests/baselines/reference/tsxReactEmit5.types
index 73e7e6ff3913e..fb5e201ca3665 100644
--- a/tests/baselines/reference/tsxReactEmit5.types
+++ b/tests/baselines/reference/tsxReactEmit5.types
@@ -24,14 +24,14 @@ import {React} from "./test";
 
 // Should emit test_1.React.createElement
 //  and React.__spread
-var foo;
+var foo: any;
 >foo : any
 
 var spread1 = <div x='' {...foo} y='' />;
 >spread1 : JSX.Element
 ><div x='' {...foo} y='' /> : JSX.Element
 >div : any
->x : any
->foo : undefined
->y : any
+>x : string
+>foo : any
+>y : string
 
diff --git a/tests/baselines/reference/tsxReactEmit6.js b/tests/baselines/reference/tsxReactEmit6.js
index 85aa8c123c99c..fb76a2e1579b3 100644
--- a/tests/baselines/reference/tsxReactEmit6.js
+++ b/tests/baselines/reference/tsxReactEmit6.js
@@ -17,7 +17,7 @@ namespace M {
 namespace M {
 	// Should emit M.React.createElement
 	//  and M.React.__spread
-	var foo;
+	var foo: any;
 	var spread1 = <div x='' {...foo} y='' />;
 
 	// Quotes
diff --git a/tests/baselines/reference/tsxReactEmit6.symbols b/tests/baselines/reference/tsxReactEmit6.symbols
index 8eb0561e185fc..eeae4493b4ff9 100644
--- a/tests/baselines/reference/tsxReactEmit6.symbols
+++ b/tests/baselines/reference/tsxReactEmit6.symbols
@@ -27,15 +27,15 @@ namespace M {
 
 	// Should emit M.React.createElement
 	//  and M.React.__spread
-	var foo;
+	var foo: any;
 >foo : Symbol(foo, Decl(react-consumer.tsx, 7, 4))
 
 	var spread1 = <div x='' {...foo} y='' />;
 >spread1 : Symbol(spread1, Decl(react-consumer.tsx, 8, 4))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 2, 22))
->x : Symbol(unknown)
+>x : Symbol(x, Decl(react-consumer.tsx, 8, 19))
 >foo : Symbol(foo, Decl(react-consumer.tsx, 7, 4))
->y : Symbol(unknown)
+>y : Symbol(y, Decl(react-consumer.tsx, 8, 33))
 
 	// Quotes
 	var x = <div>This "quote" thing</div>;
diff --git a/tests/baselines/reference/tsxReactEmit6.types b/tests/baselines/reference/tsxReactEmit6.types
index ae56de052cc44..7cf08b8f0f5b8 100644
--- a/tests/baselines/reference/tsxReactEmit6.types
+++ b/tests/baselines/reference/tsxReactEmit6.types
@@ -27,16 +27,16 @@ namespace M {
 
 	// Should emit M.React.createElement
 	//  and M.React.__spread
-	var foo;
+	var foo: any;
 >foo : any
 
 	var spread1 = <div x='' {...foo} y='' />;
 >spread1 : JSX.Element
 ><div x='' {...foo} y='' /> : JSX.Element
 >div : any
->x : any
->foo : undefined
->y : any
+>x : string
+>foo : any
+>y : string
 
 	// Quotes
 	var x = <div>This "quote" thing</div>;
diff --git a/tests/baselines/reference/tsxReactEmitEntities.symbols b/tests/baselines/reference/tsxReactEmitEntities.symbols
index 470c6177842db..edb7f038c7b7d 100644
--- a/tests/baselines/reference/tsxReactEmitEntities.symbols
+++ b/tests/baselines/reference/tsxReactEmitEntities.symbols
@@ -35,18 +35,18 @@ declare var React: any;
 // Also works in string literal attributes
 <div attr="&#0123;&hellip;&#x7D;\"></div>;
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->attr : Symbol(unknown)
+>attr : Symbol(attr, Decl(file.tsx, 15, 4))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
 // Does not happen for a string literal that happens to be inside an attribute (and escapes then work)
 <div attr={"&#0123;&hellip;&#x7D;\""}></div>;
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->attr : Symbol(unknown)
+>attr : Symbol(attr, Decl(file.tsx, 17, 4))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
 // Preserves single quotes
 <div attr='"'></div>
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
->attr : Symbol(unknown)
+>attr : Symbol(attr, Decl(file.tsx, 19, 4))
 >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
 
diff --git a/tests/baselines/reference/tsxReactEmitEntities.types b/tests/baselines/reference/tsxReactEmitEntities.types
index 34ef6dff0a867..92d2b729dd552 100644
--- a/tests/baselines/reference/tsxReactEmitEntities.types
+++ b/tests/baselines/reference/tsxReactEmitEntities.types
@@ -40,14 +40,14 @@ declare var React: any;
 <div attr="&#0123;&hellip;&#x7D;\"></div>;
 ><div attr="&#0123;&hellip;&#x7D;\"></div> : JSX.Element
 >div : any
->attr : any
+>attr : string
 >div : any
 
 // Does not happen for a string literal that happens to be inside an attribute (and escapes then work)
 <div attr={"&#0123;&hellip;&#x7D;\""}></div>;
 ><div attr={"&#0123;&hellip;&#x7D;\""}></div> : JSX.Element
 >div : any
->attr : any
+>attr : string
 >"&#0123;&hellip;&#x7D;\"" : "&#0123;&hellip;&#x7D;\""
 >div : any
 
@@ -55,6 +55,6 @@ declare var React: any;
 <div attr='"'></div>
 ><div attr='"'></div> : JSX.Element
 >div : any
->attr : any
+>attr : string
 >div : any
 
diff --git a/tests/baselines/reference/tsxReactEmitNesting.symbols b/tests/baselines/reference/tsxReactEmitNesting.symbols
index efccb60274703..caf2425491e68 100644
--- a/tests/baselines/reference/tsxReactEmitNesting.symbols
+++ b/tests/baselines/reference/tsxReactEmitNesting.symbols
@@ -17,11 +17,11 @@ let render = (ctrl, model) =>
 
     <section class="todoapp">
 >section : Symbol(unknown)
->class : Symbol(unknown)
+>class : Symbol(class, Decl(file.tsx, 7, 12))
 
         <header class="header">
 >header : Symbol(unknown)
->class : Symbol(unknown)
+>class : Symbol(class, Decl(file.tsx, 8, 15))
 
             <h1>todos &lt;x&gt;</h1>
 >h1 : Symbol(unknown)
@@ -29,13 +29,13 @@ let render = (ctrl, model) =>
 
             <input class="new-todo" autofocus autocomplete="off" placeholder="What needs to be done?" value={model.newTodo} onKeyup={ctrl.addTodo.bind(ctrl, model)} />
 >input : Symbol(unknown)
->class : Symbol(unknown)
->autofocus : Symbol(unknown)
->autocomplete : Symbol(unknown)
->placeholder : Symbol(unknown)
->value : Symbol(unknown)
+>class : Symbol(class, Decl(file.tsx, 10, 18))
+>autofocus : Symbol(autofocus, Decl(file.tsx, 10, 35))
+>autocomplete : Symbol(autocomplete, Decl(file.tsx, 10, 45))
+>placeholder : Symbol(placeholder, Decl(file.tsx, 10, 64))
+>value : Symbol(value, Decl(file.tsx, 10, 101))
 >model : Symbol(model, Decl(file.tsx, 6, 19))
->onKeyup : Symbol(unknown)
+>onKeyup : Symbol(onKeyup, Decl(file.tsx, 10, 123))
 >ctrl : Symbol(ctrl, Decl(file.tsx, 6, 14))
 >ctrl : Symbol(ctrl, Decl(file.tsx, 6, 14))
 >model : Symbol(model, Decl(file.tsx, 6, 19))
@@ -45,23 +45,23 @@ let render = (ctrl, model) =>
 
         <section class="main" style={{display:(model.todos && model.todos.length) ? "block" : "none"}}>
 >section : Symbol(unknown)
->class : Symbol(unknown)
->style : Symbol(unknown)
+>class : Symbol(class, Decl(file.tsx, 12, 16))
+>style : Symbol(style, Decl(file.tsx, 12, 29))
 >display : Symbol(display, Decl(file.tsx, 12, 38))
 >model : Symbol(model, Decl(file.tsx, 6, 19))
 >model : Symbol(model, Decl(file.tsx, 6, 19))
 
             <input class="toggle-all" type="checkbox" onChange={ctrl.toggleAll.bind(ctrl)}/>
 >input : Symbol(unknown)
->class : Symbol(unknown)
->type : Symbol(unknown)
->onChange : Symbol(unknown)
+>class : Symbol(class, Decl(file.tsx, 13, 18))
+>type : Symbol(type, Decl(file.tsx, 13, 37))
+>onChange : Symbol(onChange, Decl(file.tsx, 13, 53))
 >ctrl : Symbol(ctrl, Decl(file.tsx, 6, 14))
 >ctrl : Symbol(ctrl, Decl(file.tsx, 6, 14))
 
             <ul class="todo-list">
 >ul : Symbol(unknown)
->class : Symbol(unknown)
+>class : Symbol(class, Decl(file.tsx, 14, 15))
 
                 {model.filteredTodos.map((todo) =>
 >model : Symbol(model, Decl(file.tsx, 6, 19))
@@ -69,7 +69,7 @@ let render = (ctrl, model) =>
 
                     <li class={{todo: true, completed: todo.completed, editing: todo == model.editedTodo}}>
 >li : Symbol(unknown)
->class : Symbol(unknown)
+>class : Symbol(class, Decl(file.tsx, 16, 23))
 >todo : Symbol(todo, Decl(file.tsx, 16, 32))
 >completed : Symbol(completed, Decl(file.tsx, 16, 43))
 >todo : Symbol(todo, Decl(file.tsx, 15, 42))
@@ -79,22 +79,22 @@ let render = (ctrl, model) =>
 
                         <div class="view">
 >div : Symbol(unknown)
->class : Symbol(unknown)
+>class : Symbol(class, Decl(file.tsx, 17, 28))
 
                             {(!todo.editable) ?
 >todo : Symbol(todo, Decl(file.tsx, 15, 42))
 
                                 <input class="toggle" type="checkbox"></input>
 >input : Symbol(unknown)
->class : Symbol(unknown)
->type : Symbol(unknown)
+>class : Symbol(class, Decl(file.tsx, 19, 38))
+>type : Symbol(type, Decl(file.tsx, 19, 53))
 >input : Symbol(unknown)
 
                                 : null
                             }
                             <label onDoubleClick={()=>{ctrl.editTodo(todo)}}>{todo.title}</label>
 >label : Symbol(unknown)
->onDoubleClick : Symbol(unknown)
+>onDoubleClick : Symbol(onDoubleClick, Decl(file.tsx, 22, 34))
 >ctrl : Symbol(ctrl, Decl(file.tsx, 6, 14))
 >todo : Symbol(todo, Decl(file.tsx, 15, 42))
 >todo : Symbol(todo, Decl(file.tsx, 15, 42))
@@ -102,8 +102,8 @@ let render = (ctrl, model) =>
 
                             <button class="destroy" onClick={ctrl.removeTodo.bind(ctrl,todo)}></button>
 >button : Symbol(unknown)
->class : Symbol(unknown)
->onClick : Symbol(unknown)
+>class : Symbol(class, Decl(file.tsx, 23, 35))
+>onClick : Symbol(onClick, Decl(file.tsx, 23, 51))
 >ctrl : Symbol(ctrl, Decl(file.tsx, 6, 14))
 >ctrl : Symbol(ctrl, Decl(file.tsx, 6, 14))
 >todo : Symbol(todo, Decl(file.tsx, 15, 42))
@@ -111,11 +111,11 @@ let render = (ctrl, model) =>
 
                             <div class="iconBorder">
 >div : Symbol(unknown)
->class : Symbol(unknown)
+>class : Symbol(class, Decl(file.tsx, 24, 32))
 
                                 <div class="icon"/>
 >div : Symbol(unknown)
->class : Symbol(unknown)
+>class : Symbol(class, Decl(file.tsx, 25, 36))
 
                             </div>
 >div : Symbol(unknown)
diff --git a/tests/baselines/reference/tsxReactEmitNesting.types b/tests/baselines/reference/tsxReactEmitNesting.types
index 7a1b3e82441e9..c456fd507bf21 100644
--- a/tests/baselines/reference/tsxReactEmitNesting.types
+++ b/tests/baselines/reference/tsxReactEmitNesting.types
@@ -19,12 +19,12 @@ let render = (ctrl, model) =>
     <section class="todoapp">
 ><section class="todoapp">        <header class="header">            <h1>todos &lt;x&gt;</h1>            <input class="new-todo" autofocus autocomplete="off" placeholder="What needs to be done?" value={model.newTodo} onKeyup={ctrl.addTodo.bind(ctrl, model)} />        </header>        <section class="main" style={{display:(model.todos && model.todos.length) ? "block" : "none"}}>            <input class="toggle-all" type="checkbox" onChange={ctrl.toggleAll.bind(ctrl)}/>            <ul class="todo-list">                {model.filteredTodos.map((todo) =>                    <li class={{todo: true, completed: todo.completed, editing: todo == model.editedTodo}}>                        <div class="view">                            {(!todo.editable) ?                                <input class="toggle" type="checkbox"></input>                                : null                            }                            <label onDoubleClick={()=>{ctrl.editTodo(todo)}}>{todo.title}</label>                            <button class="destroy" onClick={ctrl.removeTodo.bind(ctrl,todo)}></button>                            <div class="iconBorder">                                <div class="icon"/>                            </div>                        </div>                    </li>                )}            </ul>        </section>    </section> : any
 >section : any
->class : any
+>class : string
 
         <header class="header">
 ><header class="header">            <h1>todos &lt;x&gt;</h1>            <input class="new-todo" autofocus autocomplete="off" placeholder="What needs to be done?" value={model.newTodo} onKeyup={ctrl.addTodo.bind(ctrl, model)} />        </header> : any
 >header : any
->class : any
+>class : string
 
             <h1>todos &lt;x&gt;</h1>
 ><h1>todos &lt;x&gt;</h1> : any
@@ -34,10 +34,10 @@ let render = (ctrl, model) =>
             <input class="new-todo" autofocus autocomplete="off" placeholder="What needs to be done?" value={model.newTodo} onKeyup={ctrl.addTodo.bind(ctrl, model)} />
 ><input class="new-todo" autofocus autocomplete="off" placeholder="What needs to be done?" value={model.newTodo} onKeyup={ctrl.addTodo.bind(ctrl, model)} /> : any
 >input : any
->class : any
->autofocus : any
->autocomplete : any
->placeholder : any
+>class : string
+>autofocus : true
+>autocomplete : string
+>placeholder : string
 >value : any
 >model.newTodo : any
 >model : any
@@ -58,8 +58,8 @@ let render = (ctrl, model) =>
         <section class="main" style={{display:(model.todos && model.todos.length) ? "block" : "none"}}>
 ><section class="main" style={{display:(model.todos && model.todos.length) ? "block" : "none"}}>            <input class="toggle-all" type="checkbox" onChange={ctrl.toggleAll.bind(ctrl)}/>            <ul class="todo-list">                {model.filteredTodos.map((todo) =>                    <li class={{todo: true, completed: todo.completed, editing: todo == model.editedTodo}}>                        <div class="view">                            {(!todo.editable) ?                                <input class="toggle" type="checkbox"></input>                                : null                            }                            <label onDoubleClick={()=>{ctrl.editTodo(todo)}}>{todo.title}</label>                            <button class="destroy" onClick={ctrl.removeTodo.bind(ctrl,todo)}></button>                            <div class="iconBorder">                                <div class="icon"/>                            </div>                        </div>                    </li>                )}            </ul>        </section> : any
 >section : any
->class : any
->style : any
+>class : string
+>style : { display: string; }
 >{display:(model.todos && model.todos.length) ? "block" : "none"} : { display: string; }
 >display : string
 >(model.todos && model.todos.length) ? "block" : "none" : "block" | "none"
@@ -79,8 +79,8 @@ let render = (ctrl, model) =>
             <input class="toggle-all" type="checkbox" onChange={ctrl.toggleAll.bind(ctrl)}/>
 ><input class="toggle-all" type="checkbox" onChange={ctrl.toggleAll.bind(ctrl)}/> : any
 >input : any
->class : any
->type : any
+>class : string
+>type : string
 >onChange : any
 >ctrl.toggleAll.bind(ctrl) : any
 >ctrl.toggleAll.bind : any
@@ -93,7 +93,7 @@ let render = (ctrl, model) =>
             <ul class="todo-list">
 ><ul class="todo-list">                {model.filteredTodos.map((todo) =>                    <li class={{todo: true, completed: todo.completed, editing: todo == model.editedTodo}}>                        <div class="view">                            {(!todo.editable) ?                                <input class="toggle" type="checkbox"></input>                                : null                            }                            <label onDoubleClick={()=>{ctrl.editTodo(todo)}}>{todo.title}</label>                            <button class="destroy" onClick={ctrl.removeTodo.bind(ctrl,todo)}></button>                            <div class="iconBorder">                                <div class="icon"/>                            </div>                        </div>                    </li>                )}            </ul> : any
 >ul : any
->class : any
+>class : string
 
                 {model.filteredTodos.map((todo) =>
 >model.filteredTodos.map((todo) =>                    <li class={{todo: true, completed: todo.completed, editing: todo == model.editedTodo}}>                        <div class="view">                            {(!todo.editable) ?                                <input class="toggle" type="checkbox"></input>                                : null                            }                            <label onDoubleClick={()=>{ctrl.editTodo(todo)}}>{todo.title}</label>                            <button class="destroy" onClick={ctrl.removeTodo.bind(ctrl,todo)}></button>                            <div class="iconBorder">                                <div class="icon"/>                            </div>                        </div>                    </li>                ) : any
@@ -108,7 +108,7 @@ let render = (ctrl, model) =>
                     <li class={{todo: true, completed: todo.completed, editing: todo == model.editedTodo}}>
 ><li class={{todo: true, completed: todo.completed, editing: todo == model.editedTodo}}>                        <div class="view">                            {(!todo.editable) ?                                <input class="toggle" type="checkbox"></input>                                : null                            }                            <label onDoubleClick={()=>{ctrl.editTodo(todo)}}>{todo.title}</label>                            <button class="destroy" onClick={ctrl.removeTodo.bind(ctrl,todo)}></button>                            <div class="iconBorder">                                <div class="icon"/>                            </div>                        </div>                    </li> : any
 >li : any
->class : any
+>class : { todo: boolean; completed: any; editing: boolean; }
 >{todo: true, completed: todo.completed, editing: todo == model.editedTodo} : { todo: boolean; completed: any; editing: boolean; }
 >todo : boolean
 >true : true
@@ -126,7 +126,7 @@ let render = (ctrl, model) =>
                         <div class="view">
 ><div class="view">                            {(!todo.editable) ?                                <input class="toggle" type="checkbox"></input>                                : null                            }                            <label onDoubleClick={()=>{ctrl.editTodo(todo)}}>{todo.title}</label>                            <button class="destroy" onClick={ctrl.removeTodo.bind(ctrl,todo)}></button>                            <div class="iconBorder">                                <div class="icon"/>                            </div>                        </div> : any
 >div : any
->class : any
+>class : string
 
                             {(!todo.editable) ?
 >(!todo.editable) ?                                <input class="toggle" type="checkbox"></input>                                : null : any
@@ -139,8 +139,8 @@ let render = (ctrl, model) =>
                                 <input class="toggle" type="checkbox"></input>
 ><input class="toggle" type="checkbox"></input> : any
 >input : any
->class : any
->type : any
+>class : string
+>type : string
 >input : any
 
                                 : null
@@ -149,7 +149,7 @@ let render = (ctrl, model) =>
                             <label onDoubleClick={()=>{ctrl.editTodo(todo)}}>{todo.title}</label>
 ><label onDoubleClick={()=>{ctrl.editTodo(todo)}}>{todo.title}</label> : any
 >label : any
->onDoubleClick : any
+>onDoubleClick : () => void
 >()=>{ctrl.editTodo(todo)} : () => void
 >ctrl.editTodo(todo) : any
 >ctrl.editTodo : any
@@ -164,7 +164,7 @@ let render = (ctrl, model) =>
                             <button class="destroy" onClick={ctrl.removeTodo.bind(ctrl,todo)}></button>
 ><button class="destroy" onClick={ctrl.removeTodo.bind(ctrl,todo)}></button> : any
 >button : any
->class : any
+>class : string
 >onClick : any
 >ctrl.removeTodo.bind(ctrl,todo) : any
 >ctrl.removeTodo.bind : any
@@ -179,12 +179,12 @@ let render = (ctrl, model) =>
                             <div class="iconBorder">
 ><div class="iconBorder">                                <div class="icon"/>                            </div> : any
 >div : any
->class : any
+>class : string
 
                                 <div class="icon"/>
 ><div class="icon"/> : any
 >div : any
->class : any
+>class : string
 
                             </div>
 >div : any
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution1.js b/tests/baselines/reference/tsxSpreadAttributesResolution1.js
new file mode 100644
index 0000000000000..538bf316743d6
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution1.js
@@ -0,0 +1,38 @@
+//// [file.tsx]
+
+import React = require('react');
+
+class Poisoned extends React.Component<{}, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+const obj: Object = {};
+
+// OK
+let p = <Poisoned {...obj} />;
+let y = <Poisoned />;
+
+//// [file.jsx]
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var React = require("react");
+var Poisoned = (function (_super) {
+    __extends(Poisoned, _super);
+    function Poisoned() {
+        return _super.apply(this, arguments) || this;
+    }
+    Poisoned.prototype.render = function () {
+        return <div>Hello</div>;
+    };
+    return Poisoned;
+}(React.Component));
+var obj = {};
+// OK
+var p = <Poisoned {...obj}/>;
+var y = <Poisoned />;
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution1.symbols b/tests/baselines/reference/tsxSpreadAttributesResolution1.symbols
new file mode 100644
index 0000000000000..d14e939ed7554
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution1.symbols
@@ -0,0 +1,34 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+
+class Poisoned extends React.Component<{}, {}> {
+>Poisoned : Symbol(Poisoned, Decl(file.tsx, 1, 32))
+>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+
+    render() {
+>render : Symbol(Poisoned.render, Decl(file.tsx, 3, 48))
+
+        return <div>Hello</div>;
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
+    }
+}
+
+const obj: Object = {};
+>obj : Symbol(obj, Decl(file.tsx, 9, 5))
+>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
+
+// OK
+let p = <Poisoned {...obj} />;
+>p : Symbol(p, Decl(file.tsx, 12, 3))
+>Poisoned : Symbol(Poisoned, Decl(file.tsx, 1, 32))
+>obj : Symbol(obj, Decl(file.tsx, 9, 5))
+
+let y = <Poisoned />;
+>y : Symbol(y, Decl(file.tsx, 13, 3))
+>Poisoned : Symbol(Poisoned, Decl(file.tsx, 1, 32))
+
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution1.types b/tests/baselines/reference/tsxSpreadAttributesResolution1.types
new file mode 100644
index 0000000000000..5b3182f63070d
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution1.types
@@ -0,0 +1,38 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : typeof React
+
+class Poisoned extends React.Component<{}, {}> {
+>Poisoned : Poisoned
+>React.Component : React.Component<{}, {}>
+>React : typeof React
+>Component : typeof React.Component
+
+    render() {
+>render : () => JSX.Element
+
+        return <div>Hello</div>;
+><div>Hello</div> : JSX.Element
+>div : any
+>div : any
+    }
+}
+
+const obj: Object = {};
+>obj : Object
+>Object : Object
+>{} : {}
+
+// OK
+let p = <Poisoned {...obj} />;
+>p : JSX.Element
+><Poisoned {...obj} /> : JSX.Element
+>Poisoned : typeof Poisoned
+>obj : Object
+
+let y = <Poisoned />;
+>y : JSX.Element
+><Poisoned /> : JSX.Element
+>Poisoned : typeof Poisoned
+
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution10.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution10.errors.txt
new file mode 100644
index 0000000000000..338e03a8e02bf
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution10.errors.txt
@@ -0,0 +1,63 @@
+tests/cases/conformance/jsx/file.tsx(20,14): error TS2322: Type '{ x: 3; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Opt> & OptionProp & { children?: ReactNode; }'.
+  Type '{ x: 3; }' is not assignable to type 'OptionProp'.
+    Types of property 'x' are incompatible.
+      Type '3' is not assignable to type '2'.
+tests/cases/conformance/jsx/file.tsx(21,15): error TS2322: Type '{ x: "Hi"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Opt> & OptionProp & { children?: ReactNode; }'.
+  Type '{ x: "Hi"; }' is not assignable to type 'OptionProp'.
+    Types of property 'x' are incompatible.
+      Type '"Hi"' is not assignable to type '2'.
+tests/cases/conformance/jsx/file.tsx(22,15): error TS2322: Type '{ x: 3; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Opt> & OptionProp & { children?: ReactNode; }'.
+  Type '{ x: 3; }' is not assignable to type 'OptionProp'.
+    Types of property 'x' are incompatible.
+      Type '3' is not assignable to type '2'.
+tests/cases/conformance/jsx/file.tsx(23,15): error TS2322: Type '{ x: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Opt> & OptionProp & { children?: ReactNode; }'.
+  Type '{ x: true; }' is not assignable to type 'OptionProp'.
+    Types of property 'x' are incompatible.
+      Type 'true' is not assignable to type '2'.
+
+
+==== tests/cases/conformance/jsx/file.tsx (4 errors) ====
+    
+    import React = require('react');
+    
+    interface OptionProp {
+        x?: 2
+    }
+    
+    class Opt extends React.Component<OptionProp, {}> {
+        render() {
+            return <div>Hello</div>;
+        }
+    }
+    
+    const obj: OptionProp = {};
+    const obj1: OptionProp = {
+        x: 2
+    }
+    
+    // Error
+    let y = <Opt {...obj} x={3}/>;
+                 ~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ x: 3; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Opt> & OptionProp & { children?: ReactNode; }'.
+!!! error TS2322:   Type '{ x: 3; }' is not assignable to type 'OptionProp'.
+!!! error TS2322:     Types of property 'x' are incompatible.
+!!! error TS2322:       Type '3' is not assignable to type '2'.
+    let y1 = <Opt {...obj1} x="Hi"/>;
+                  ~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ x: "Hi"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Opt> & OptionProp & { children?: ReactNode; }'.
+!!! error TS2322:   Type '{ x: "Hi"; }' is not assignable to type 'OptionProp'.
+!!! error TS2322:     Types of property 'x' are incompatible.
+!!! error TS2322:       Type '"Hi"' is not assignable to type '2'.
+    let y2 = <Opt {...obj1} x={3}/>;
+                  ~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ x: 3; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Opt> & OptionProp & { children?: ReactNode; }'.
+!!! error TS2322:   Type '{ x: 3; }' is not assignable to type 'OptionProp'.
+!!! error TS2322:     Types of property 'x' are incompatible.
+!!! error TS2322:       Type '3' is not assignable to type '2'.
+    let y3 = <Opt x />;
+                  ~
+!!! error TS2322: Type '{ x: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Opt> & OptionProp & { children?: ReactNode; }'.
+!!! error TS2322:   Type '{ x: true; }' is not assignable to type 'OptionProp'.
+!!! error TS2322:     Types of property 'x' are incompatible.
+!!! error TS2322:       Type 'true' is not assignable to type '2'.
+    
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution10.js b/tests/baselines/reference/tsxSpreadAttributesResolution10.js
new file mode 100644
index 0000000000000..a460af219af8e
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution10.js
@@ -0,0 +1,53 @@
+//// [file.tsx]
+
+import React = require('react');
+
+interface OptionProp {
+    x?: 2
+}
+
+class Opt extends React.Component<OptionProp, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+const obj: OptionProp = {};
+const obj1: OptionProp = {
+    x: 2
+}
+
+// Error
+let y = <Opt {...obj} x={3}/>;
+let y1 = <Opt {...obj1} x="Hi"/>;
+let y2 = <Opt {...obj1} x={3}/>;
+let y3 = <Opt x />;
+
+
+//// [file.jsx]
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var React = require("react");
+var Opt = (function (_super) {
+    __extends(Opt, _super);
+    function Opt() {
+        return _super.apply(this, arguments) || this;
+    }
+    Opt.prototype.render = function () {
+        return <div>Hello</div>;
+    };
+    return Opt;
+}(React.Component));
+var obj = {};
+var obj1 = {
+    x: 2
+};
+// Error
+var y = <Opt {...obj} x={3}/>;
+var y1 = <Opt {...obj1} x="Hi"/>;
+var y2 = <Opt {...obj1} x={3}/>;
+var y3 = <Opt x/>;
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution11.js b/tests/baselines/reference/tsxSpreadAttributesResolution11.js
new file mode 100644
index 0000000000000..5d50ef9289eb7
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution11.js
@@ -0,0 +1,68 @@
+//// [file.tsx]
+
+import React = require('react');
+
+const obj = {};
+const obj1: { x: 2 } = {
+    x: 2
+}
+const obj3: {y: true, overwrite: string } = {
+    y: true,
+    overwrite: "hi"
+}
+
+interface Prop {
+    x: 2
+    y: true
+    overwrite: string
+}
+
+class OverWriteAttr extends React.Component<Prop, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+let anyobj: any;
+// OK
+let x = <OverWriteAttr {...obj} y overwrite="hi" {...obj1} />
+let x1 = <OverWriteAttr {...obj1} {...obj3} />
+let x2 = <OverWriteAttr x={3} overwrite="hi" {...obj1} {...{y: true}} />
+let x3 = <OverWriteAttr overwrite="hi" {...obj1} x={3} {...{y: true, x: 2, overwrite:"world"}} />
+let x4 = <OverWriteAttr {...{x: 2}} {...{overwrite: "world"}} {...{y: true}} />
+let x5 = <OverWriteAttr {...anyobj} />
+
+//// [file.jsx]
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var React = require("react");
+var obj = {};
+var obj1 = {
+    x: 2
+};
+var obj3 = {
+    y: true,
+    overwrite: "hi"
+};
+var OverWriteAttr = (function (_super) {
+    __extends(OverWriteAttr, _super);
+    function OverWriteAttr() {
+        return _super.apply(this, arguments) || this;
+    }
+    OverWriteAttr.prototype.render = function () {
+        return <div>Hello</div>;
+    };
+    return OverWriteAttr;
+}(React.Component));
+var anyobj;
+// OK
+var x = <OverWriteAttr {...obj} y overwrite="hi" {...obj1}/>;
+var x1 = <OverWriteAttr {...obj1} {...obj3}/>;
+var x2 = <OverWriteAttr x={3} overwrite="hi" {...obj1} {...{ y: true }}/>;
+var x3 = <OverWriteAttr overwrite="hi" {...obj1} x={3} {...{ y: true, x: 2, overwrite: "world" }}/>;
+var x4 = <OverWriteAttr {...{ x: 2 }} {...{ overwrite: "world" }} {...{ y: true }}/>;
+var x5 = <OverWriteAttr {...anyobj}/>;
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution11.symbols b/tests/baselines/reference/tsxSpreadAttributesResolution11.symbols
new file mode 100644
index 0000000000000..c29ca5cd66259
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution11.symbols
@@ -0,0 +1,104 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+
+const obj = {};
+>obj : Symbol(obj, Decl(file.tsx, 3, 5))
+
+const obj1: { x: 2 } = {
+>obj1 : Symbol(obj1, Decl(file.tsx, 4, 5))
+>x : Symbol(x, Decl(file.tsx, 4, 13))
+
+    x: 2
+>x : Symbol(x, Decl(file.tsx, 4, 24))
+}
+const obj3: {y: true, overwrite: string } = {
+>obj3 : Symbol(obj3, Decl(file.tsx, 7, 5))
+>y : Symbol(y, Decl(file.tsx, 7, 13))
+>overwrite : Symbol(overwrite, Decl(file.tsx, 7, 21))
+
+    y: true,
+>y : Symbol(y, Decl(file.tsx, 7, 45))
+
+    overwrite: "hi"
+>overwrite : Symbol(overwrite, Decl(file.tsx, 8, 12))
+}
+
+interface Prop {
+>Prop : Symbol(Prop, Decl(file.tsx, 10, 1))
+
+    x: 2
+>x : Symbol(Prop.x, Decl(file.tsx, 12, 16))
+
+    y: true
+>y : Symbol(Prop.y, Decl(file.tsx, 13, 8))
+
+    overwrite: string
+>overwrite : Symbol(Prop.overwrite, Decl(file.tsx, 14, 11))
+}
+
+class OverWriteAttr extends React.Component<Prop, {}> {
+>OverWriteAttr : Symbol(OverWriteAttr, Decl(file.tsx, 16, 1))
+>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>Prop : Symbol(Prop, Decl(file.tsx, 10, 1))
+
+    render() {
+>render : Symbol(OverWriteAttr.render, Decl(file.tsx, 18, 55))
+
+        return <div>Hello</div>;
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
+    }
+}
+
+let anyobj: any;
+>anyobj : Symbol(anyobj, Decl(file.tsx, 24, 3))
+
+// OK
+let x = <OverWriteAttr {...obj} y overwrite="hi" {...obj1} />
+>x : Symbol(x, Decl(file.tsx, 26, 3))
+>OverWriteAttr : Symbol(OverWriteAttr, Decl(file.tsx, 16, 1))
+>obj : Symbol(obj, Decl(file.tsx, 3, 5))
+>y : Symbol(y, Decl(file.tsx, 26, 31))
+>overwrite : Symbol(overwrite, Decl(file.tsx, 26, 33))
+>obj1 : Symbol(obj1, Decl(file.tsx, 4, 5))
+
+let x1 = <OverWriteAttr {...obj1} {...obj3} />
+>x1 : Symbol(x1, Decl(file.tsx, 27, 3))
+>OverWriteAttr : Symbol(OverWriteAttr, Decl(file.tsx, 16, 1))
+>obj1 : Symbol(obj1, Decl(file.tsx, 4, 5))
+>obj3 : Symbol(obj3, Decl(file.tsx, 7, 5))
+
+let x2 = <OverWriteAttr x={3} overwrite="hi" {...obj1} {...{y: true}} />
+>x2 : Symbol(x2, Decl(file.tsx, 28, 3))
+>OverWriteAttr : Symbol(OverWriteAttr, Decl(file.tsx, 16, 1))
+>x : Symbol(x, Decl(file.tsx, 28, 23))
+>overwrite : Symbol(overwrite, Decl(file.tsx, 28, 29))
+>obj1 : Symbol(obj1, Decl(file.tsx, 4, 5))
+>y : Symbol(y, Decl(file.tsx, 28, 60))
+
+let x3 = <OverWriteAttr overwrite="hi" {...obj1} x={3} {...{y: true, x: 2, overwrite:"world"}} />
+>x3 : Symbol(x3, Decl(file.tsx, 29, 3))
+>OverWriteAttr : Symbol(OverWriteAttr, Decl(file.tsx, 16, 1))
+>overwrite : Symbol(overwrite, Decl(file.tsx, 29, 23))
+>obj1 : Symbol(obj1, Decl(file.tsx, 4, 5))
+>x : Symbol(x, Decl(file.tsx, 29, 48))
+>y : Symbol(y, Decl(file.tsx, 29, 60))
+>x : Symbol(x, Decl(file.tsx, 29, 68))
+>overwrite : Symbol(overwrite, Decl(file.tsx, 29, 74))
+
+let x4 = <OverWriteAttr {...{x: 2}} {...{overwrite: "world"}} {...{y: true}} />
+>x4 : Symbol(x4, Decl(file.tsx, 30, 3))
+>OverWriteAttr : Symbol(OverWriteAttr, Decl(file.tsx, 16, 1))
+>x : Symbol(x, Decl(file.tsx, 30, 29))
+>overwrite : Symbol(overwrite, Decl(file.tsx, 30, 41))
+>y : Symbol(y, Decl(file.tsx, 30, 67))
+
+let x5 = <OverWriteAttr {...anyobj} />
+>x5 : Symbol(x5, Decl(file.tsx, 31, 3))
+>OverWriteAttr : Symbol(OverWriteAttr, Decl(file.tsx, 16, 1))
+>anyobj : Symbol(anyobj, Decl(file.tsx, 24, 3))
+
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution11.types b/tests/baselines/reference/tsxSpreadAttributesResolution11.types
new file mode 100644
index 0000000000000..30a123c4450e6
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution11.types
@@ -0,0 +1,133 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : typeof React
+
+const obj = {};
+>obj : {}
+>{} : {}
+
+const obj1: { x: 2 } = {
+>obj1 : { x: 2; }
+>x : 2
+>{    x: 2} : { x: 2; }
+
+    x: 2
+>x : number
+>2 : 2
+}
+const obj3: {y: true, overwrite: string } = {
+>obj3 : { y: true; overwrite: string; }
+>y : true
+>true : true
+>overwrite : string
+>{    y: true,    overwrite: "hi"} : { y: true; overwrite: string; }
+
+    y: true,
+>y : boolean
+>true : true
+
+    overwrite: "hi"
+>overwrite : string
+>"hi" : "hi"
+}
+
+interface Prop {
+>Prop : Prop
+
+    x: 2
+>x : 2
+
+    y: true
+>y : true
+>true : true
+
+    overwrite: string
+>overwrite : string
+}
+
+class OverWriteAttr extends React.Component<Prop, {}> {
+>OverWriteAttr : OverWriteAttr
+>React.Component : React.Component<Prop, {}>
+>React : typeof React
+>Component : typeof React.Component
+>Prop : Prop
+
+    render() {
+>render : () => JSX.Element
+
+        return <div>Hello</div>;
+><div>Hello</div> : JSX.Element
+>div : any
+>div : any
+    }
+}
+
+let anyobj: any;
+>anyobj : any
+
+// OK
+let x = <OverWriteAttr {...obj} y overwrite="hi" {...obj1} />
+>x : JSX.Element
+><OverWriteAttr {...obj} y overwrite="hi" {...obj1} /> : JSX.Element
+>OverWriteAttr : typeof OverWriteAttr
+>obj : {}
+>y : true
+>overwrite : string
+>obj1 : { x: 2; }
+
+let x1 = <OverWriteAttr {...obj1} {...obj3} />
+>x1 : JSX.Element
+><OverWriteAttr {...obj1} {...obj3} /> : JSX.Element
+>OverWriteAttr : typeof OverWriteAttr
+>obj1 : { x: 2; }
+>obj3 : { y: true; overwrite: string; }
+
+let x2 = <OverWriteAttr x={3} overwrite="hi" {...obj1} {...{y: true}} />
+>x2 : JSX.Element
+><OverWriteAttr x={3} overwrite="hi" {...obj1} {...{y: true}} /> : JSX.Element
+>OverWriteAttr : typeof OverWriteAttr
+>x : number
+>3 : 3
+>overwrite : string
+>obj1 : { x: 2; }
+>{y: true} : { y: true; }
+>y : boolean
+>true : true
+
+let x3 = <OverWriteAttr overwrite="hi" {...obj1} x={3} {...{y: true, x: 2, overwrite:"world"}} />
+>x3 : JSX.Element
+><OverWriteAttr overwrite="hi" {...obj1} x={3} {...{y: true, x: 2, overwrite:"world"}} /> : JSX.Element
+>OverWriteAttr : typeof OverWriteAttr
+>overwrite : string
+>obj1 : { x: 2; }
+>x : number
+>3 : 3
+>{y: true, x: 2, overwrite:"world"} : { y: true; x: 2; overwrite: string; }
+>y : boolean
+>true : true
+>x : number
+>2 : 2
+>overwrite : string
+>"world" : "world"
+
+let x4 = <OverWriteAttr {...{x: 2}} {...{overwrite: "world"}} {...{y: true}} />
+>x4 : JSX.Element
+><OverWriteAttr {...{x: 2}} {...{overwrite: "world"}} {...{y: true}} /> : JSX.Element
+>OverWriteAttr : typeof OverWriteAttr
+>{x: 2} : { x: 2; }
+>x : number
+>2 : 2
+>{overwrite: "world"} : { overwrite: string; }
+>overwrite : string
+>"world" : "world"
+>{y: true} : { y: true; }
+>y : boolean
+>true : true
+
+let x5 = <OverWriteAttr {...anyobj} />
+>x5 : JSX.Element
+><OverWriteAttr {...anyobj} /> : JSX.Element
+>OverWriteAttr : typeof OverWriteAttr
+>anyobj : any
+
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution12.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution12.errors.txt
new file mode 100644
index 0000000000000..f529c3b6fddab
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution12.errors.txt
@@ -0,0 +1,52 @@
+tests/cases/conformance/jsx/file.tsx(28,24): error TS2322: Type '{ x: 2; y: true; overwrite: "hi"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<OverWriteAttr> & Prop & { children?: ReactNode; }'.
+  Type '{ x: 2; y: true; overwrite: "hi"; }' is not assignable to type 'Prop'.
+    Types of property 'y' are incompatible.
+      Type 'true' is not assignable to type 'false'.
+tests/cases/conformance/jsx/file.tsx(29,25): error TS2322: Type '{ y: true; x: 3; overwrite: "hi"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<OverWriteAttr> & Prop & { children?: ReactNode; }'.
+  Type '{ y: true; x: 3; overwrite: "hi"; }' is not assignable to type 'Prop'.
+    Types of property 'x' are incompatible.
+      Type '3' is not assignable to type '2'.
+
+
+==== tests/cases/conformance/jsx/file.tsx (2 errors) ====
+    
+    import React = require('react');
+    
+    const obj = {};
+    const obj1: {x: 2} = {
+        x: 2
+    }
+    const obj3: {y: false, overwrite: string} = {
+        y: false,
+        overwrite: "hi"
+    }
+    
+    interface Prop {
+        x: 2
+        y: false
+        overwrite: string
+    }
+    
+    class OverWriteAttr extends React.Component<Prop, {}> {
+        render() {
+            return <div>Hello</div>;
+        }
+    }
+    
+    let anyobj: any;
+    
+    // Error
+    let x = <OverWriteAttr {...obj} y overwrite="hi" {...obj1} />
+                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ x: 2; y: true; overwrite: "hi"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<OverWriteAttr> & Prop & { children?: ReactNode; }'.
+!!! error TS2322:   Type '{ x: 2; y: true; overwrite: "hi"; }' is not assignable to type 'Prop'.
+!!! error TS2322:     Types of property 'y' are incompatible.
+!!! error TS2322:       Type 'true' is not assignable to type 'false'.
+    let x1 = <OverWriteAttr overwrite="hi" {...obj1} x={3} {...{y: true}} />
+                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ y: true; x: 3; overwrite: "hi"; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<OverWriteAttr> & Prop & { children?: ReactNode; }'.
+!!! error TS2322:   Type '{ y: true; x: 3; overwrite: "hi"; }' is not assignable to type 'Prop'.
+!!! error TS2322:     Types of property 'x' are incompatible.
+!!! error TS2322:       Type '3' is not assignable to type '2'.
+    let x2 = <OverWriteAttr {...anyobj} x={3} />
+    
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution12.js b/tests/baselines/reference/tsxSpreadAttributesResolution12.js
new file mode 100644
index 0000000000000..f7655003f40d4
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution12.js
@@ -0,0 +1,64 @@
+//// [file.tsx]
+
+import React = require('react');
+
+const obj = {};
+const obj1: {x: 2} = {
+    x: 2
+}
+const obj3: {y: false, overwrite: string} = {
+    y: false,
+    overwrite: "hi"
+}
+
+interface Prop {
+    x: 2
+    y: false
+    overwrite: string
+}
+
+class OverWriteAttr extends React.Component<Prop, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+let anyobj: any;
+
+// Error
+let x = <OverWriteAttr {...obj} y overwrite="hi" {...obj1} />
+let x1 = <OverWriteAttr overwrite="hi" {...obj1} x={3} {...{y: true}} />
+let x2 = <OverWriteAttr {...anyobj} x={3} />
+
+
+//// [file.jsx]
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var React = require("react");
+var obj = {};
+var obj1 = {
+    x: 2
+};
+var obj3 = {
+    y: false,
+    overwrite: "hi"
+};
+var OverWriteAttr = (function (_super) {
+    __extends(OverWriteAttr, _super);
+    function OverWriteAttr() {
+        return _super.apply(this, arguments) || this;
+    }
+    OverWriteAttr.prototype.render = function () {
+        return <div>Hello</div>;
+    };
+    return OverWriteAttr;
+}(React.Component));
+var anyobj;
+// Error
+var x = <OverWriteAttr {...obj} y overwrite="hi" {...obj1}/>;
+var x1 = <OverWriteAttr overwrite="hi" {...obj1} x={3} {...{ y: true }}/>;
+var x2 = <OverWriteAttr {...anyobj} x={3}/>;
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution2.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution2.errors.txt
new file mode 100644
index 0000000000000..7ee18ec23bda1
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution2.errors.txt
@@ -0,0 +1,46 @@
+tests/cases/conformance/jsx/file.tsx(18,19): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
+  Type '{}' is not assignable to type 'PoisonedProp'.
+    Property 'x' is missing in type '{}'.
+tests/cases/conformance/jsx/file.tsx(19,9): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
+  Type '{}' is not assignable to type 'PoisonedProp'.
+    Property 'x' is missing in type '{}'.
+tests/cases/conformance/jsx/file.tsx(20,19): error TS2322: Type '{ x: true; y: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
+  Type '{ x: true; y: true; }' is not assignable to type 'PoisonedProp'.
+    Types of property 'x' are incompatible.
+      Type 'true' is not assignable to type 'string'.
+
+
+==== tests/cases/conformance/jsx/file.tsx (3 errors) ====
+    
+    import React = require('react');
+    
+    interface PoisonedProp {
+        x: string;
+        y: "2";
+    }
+    
+    class Poisoned extends React.Component<PoisonedProp, {}> {
+        render() {
+            return <div>Hello</div>;
+        }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+    }
+    
+    const obj = {};
+    
+    // Error
+    let p = <Poisoned {...obj} />;
+                      ~~~~~~~~
+!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
+!!! error TS2322:   Type '{}' is not assignable to type 'PoisonedProp'.
+!!! error TS2322:     Property 'x' is missing in type '{}'.
+    let y = <Poisoned />;
+            ~~~~~~~~~~~~
+!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
+!!! error TS2322:   Type '{}' is not assignable to type 'PoisonedProp'.
+!!! error TS2322:     Property 'x' is missing in type '{}'.
+    let z = <Poisoned x y/>;
+                      ~~~
+!!! error TS2322: Type '{ x: true; y: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
+!!! error TS2322:   Type '{ x: true; y: true; }' is not assignable to type 'PoisonedProp'.
+!!! error TS2322:     Types of property 'x' are incompatible.
+!!! error TS2322:       Type 'true' is not assignable to type 'string'.
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution2.js b/tests/baselines/reference/tsxSpreadAttributesResolution2.js
new file mode 100644
index 0000000000000..2847b271c8704
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution2.js
@@ -0,0 +1,45 @@
+//// [file.tsx]
+
+import React = require('react');
+
+interface PoisonedProp {
+    x: string;
+    y: "2";
+}
+
+class Poisoned extends React.Component<PoisonedProp, {}> {
+    render() {
+        return <div>Hello</div>;
+    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+}
+
+const obj = {};
+
+// Error
+let p = <Poisoned {...obj} />;
+let y = <Poisoned />;
+let z = <Poisoned x y/>;
+
+//// [file.jsx]
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var React = require("react");
+var Poisoned = (function (_super) {
+    __extends(Poisoned, _super);
+    function Poisoned() {
+        return _super.apply(this, arguments) || this;
+    }
+    Poisoned.prototype.render = function () {
+        return <div>Hello</div>;
+    };
+    return Poisoned;
+}(React.Component));
+var obj = {};
+// Error
+var p = <Poisoned {...obj}/>;
+var y = <Poisoned />;
+var z = <Poisoned x y/>;
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution3.js b/tests/baselines/reference/tsxSpreadAttributesResolution3.js
new file mode 100644
index 0000000000000..895cb96fefdca
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution3.js
@@ -0,0 +1,49 @@
+//// [file.tsx]
+
+import React = require('react');
+
+interface PoisonedProp {
+    x: string;
+    y: number;
+}
+
+class Poisoned extends React.Component<PoisonedProp, {}> {
+    render() {
+        return <div>Hello</div>;
+    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+}
+
+const obj = {
+    x: "hello world",
+    y: 2
+};
+
+// OK
+let p = <Poisoned {...obj} />;
+let y = <Poisoned x="hi" y={2} />;
+
+//// [file.jsx]
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var React = require("react");
+var Poisoned = (function (_super) {
+    __extends(Poisoned, _super);
+    function Poisoned() {
+        return _super.apply(this, arguments) || this;
+    }
+    Poisoned.prototype.render = function () {
+        return <div>Hello</div>;
+    };
+    return Poisoned;
+}(React.Component));
+var obj = {
+    x: "hello world",
+    y: 2
+};
+// OK
+var p = <Poisoned {...obj}/>;
+var y = <Poisoned x="hi" y={2}/>;
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution3.symbols b/tests/baselines/reference/tsxSpreadAttributesResolution3.symbols
new file mode 100644
index 0000000000000..6102f2d156db8
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution3.symbols
@@ -0,0 +1,54 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+
+interface PoisonedProp {
+>PoisonedProp : Symbol(PoisonedProp, Decl(file.tsx, 1, 32))
+
+    x: string;
+>x : Symbol(PoisonedProp.x, Decl(file.tsx, 3, 24))
+
+    y: number;
+>y : Symbol(PoisonedProp.y, Decl(file.tsx, 4, 14))
+}
+
+class Poisoned extends React.Component<PoisonedProp, {}> {
+>Poisoned : Symbol(Poisoned, Decl(file.tsx, 6, 1))
+>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>PoisonedProp : Symbol(PoisonedProp, Decl(file.tsx, 1, 32))
+
+    render() {
+>render : Symbol(Poisoned.render, Decl(file.tsx, 8, 58))
+
+        return <div>Hello</div>;
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
+    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+}
+
+const obj = {
+>obj : Symbol(obj, Decl(file.tsx, 14, 5))
+
+    x: "hello world",
+>x : Symbol(x, Decl(file.tsx, 14, 13))
+
+    y: 2
+>y : Symbol(y, Decl(file.tsx, 15, 21))
+
+};
+
+// OK
+let p = <Poisoned {...obj} />;
+>p : Symbol(p, Decl(file.tsx, 20, 3))
+>Poisoned : Symbol(Poisoned, Decl(file.tsx, 6, 1))
+>obj : Symbol(obj, Decl(file.tsx, 14, 5))
+
+let y = <Poisoned x="hi" y={2} />;
+>y : Symbol(y, Decl(file.tsx, 21, 3))
+>Poisoned : Symbol(Poisoned, Decl(file.tsx, 6, 1))
+>x : Symbol(x, Decl(file.tsx, 21, 17))
+>y : Symbol(y, Decl(file.tsx, 21, 24))
+
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution3.types b/tests/baselines/reference/tsxSpreadAttributesResolution3.types
new file mode 100644
index 0000000000000..f719e8c111dbd
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution3.types
@@ -0,0 +1,61 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : typeof React
+
+interface PoisonedProp {
+>PoisonedProp : PoisonedProp
+
+    x: string;
+>x : string
+
+    y: number;
+>y : number
+}
+
+class Poisoned extends React.Component<PoisonedProp, {}> {
+>Poisoned : Poisoned
+>React.Component : React.Component<PoisonedProp, {}>
+>React : typeof React
+>Component : typeof React.Component
+>PoisonedProp : PoisonedProp
+
+    render() {
+>render : () => JSX.Element
+
+        return <div>Hello</div>;
+><div>Hello</div> : JSX.Element
+>div : any
+>div : any
+    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+}
+
+const obj = {
+>obj : { x: string; y: number; }
+>{    x: "hello world",    y: 2} : { x: string; y: number; }
+
+    x: "hello world",
+>x : string
+>"hello world" : "hello world"
+
+    y: 2
+>y : number
+>2 : 2
+
+};
+
+// OK
+let p = <Poisoned {...obj} />;
+>p : JSX.Element
+><Poisoned {...obj} /> : JSX.Element
+>Poisoned : typeof Poisoned
+>obj : { x: string; y: number; }
+
+let y = <Poisoned x="hi" y={2} />;
+>y : JSX.Element
+><Poisoned x="hi" y={2} /> : JSX.Element
+>Poisoned : typeof Poisoned
+>x : string
+>y : number
+>2 : 2
+
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution4.js b/tests/baselines/reference/tsxSpreadAttributesResolution4.js
new file mode 100644
index 0000000000000..4944efbc88474
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution4.js
@@ -0,0 +1,47 @@
+//// [file.tsx]
+
+import React = require('react');
+
+interface PoisonedProp {
+    x: string;
+    y: 2;
+}
+
+class Poisoned extends React.Component<PoisonedProp, {}> {
+    render() {
+        return <div>Hello</div>;
+    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+}
+
+const obj: PoisonedProp = {
+    x: "hello world",
+    y: 2
+};
+
+// OK
+let p = <Poisoned {...obj} />;
+
+//// [file.jsx]
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var React = require("react");
+var Poisoned = (function (_super) {
+    __extends(Poisoned, _super);
+    function Poisoned() {
+        return _super.apply(this, arguments) || this;
+    }
+    Poisoned.prototype.render = function () {
+        return <div>Hello</div>;
+    };
+    return Poisoned;
+}(React.Component));
+var obj = {
+    x: "hello world",
+    y: 2
+};
+// OK
+var p = <Poisoned {...obj}/>;
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution4.symbols b/tests/baselines/reference/tsxSpreadAttributesResolution4.symbols
new file mode 100644
index 0000000000000..a4eb05c40ce57
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution4.symbols
@@ -0,0 +1,49 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+
+interface PoisonedProp {
+>PoisonedProp : Symbol(PoisonedProp, Decl(file.tsx, 1, 32))
+
+    x: string;
+>x : Symbol(PoisonedProp.x, Decl(file.tsx, 3, 24))
+
+    y: 2;
+>y : Symbol(PoisonedProp.y, Decl(file.tsx, 4, 14))
+}
+
+class Poisoned extends React.Component<PoisonedProp, {}> {
+>Poisoned : Symbol(Poisoned, Decl(file.tsx, 6, 1))
+>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>PoisonedProp : Symbol(PoisonedProp, Decl(file.tsx, 1, 32))
+
+    render() {
+>render : Symbol(Poisoned.render, Decl(file.tsx, 8, 58))
+
+        return <div>Hello</div>;
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
+    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+}
+
+const obj: PoisonedProp = {
+>obj : Symbol(obj, Decl(file.tsx, 14, 5))
+>PoisonedProp : Symbol(PoisonedProp, Decl(file.tsx, 1, 32))
+
+    x: "hello world",
+>x : Symbol(x, Decl(file.tsx, 14, 27))
+
+    y: 2
+>y : Symbol(y, Decl(file.tsx, 15, 21))
+
+};
+
+// OK
+let p = <Poisoned {...obj} />;
+>p : Symbol(p, Decl(file.tsx, 20, 3))
+>Poisoned : Symbol(Poisoned, Decl(file.tsx, 6, 1))
+>obj : Symbol(obj, Decl(file.tsx, 14, 5))
+
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution4.types b/tests/baselines/reference/tsxSpreadAttributesResolution4.types
new file mode 100644
index 0000000000000..6f0a979de3263
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution4.types
@@ -0,0 +1,54 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : typeof React
+
+interface PoisonedProp {
+>PoisonedProp : PoisonedProp
+
+    x: string;
+>x : string
+
+    y: 2;
+>y : 2
+}
+
+class Poisoned extends React.Component<PoisonedProp, {}> {
+>Poisoned : Poisoned
+>React.Component : React.Component<PoisonedProp, {}>
+>React : typeof React
+>Component : typeof React.Component
+>PoisonedProp : PoisonedProp
+
+    render() {
+>render : () => JSX.Element
+
+        return <div>Hello</div>;
+><div>Hello</div> : JSX.Element
+>div : any
+>div : any
+    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+}
+
+const obj: PoisonedProp = {
+>obj : PoisonedProp
+>PoisonedProp : PoisonedProp
+>{    x: "hello world",    y: 2} : { x: string; y: 2; }
+
+    x: "hello world",
+>x : string
+>"hello world" : "hello world"
+
+    y: 2
+>y : number
+>2 : 2
+
+};
+
+// OK
+let p = <Poisoned {...obj} />;
+>p : JSX.Element
+><Poisoned {...obj} /> : JSX.Element
+>Poisoned : typeof Poisoned
+>obj : PoisonedProp
+
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution5.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution5.errors.txt
new file mode 100644
index 0000000000000..2fc933a07203f
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution5.errors.txt
@@ -0,0 +1,33 @@
+tests/cases/conformance/jsx/file.tsx(21,19): error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
+  Type '{ x: string; y: number; }' is not assignable to type 'PoisonedProp'.
+    Types of property 'y' are incompatible.
+      Type 'number' is not assignable to type '2'.
+
+
+==== tests/cases/conformance/jsx/file.tsx (1 errors) ====
+    
+    import React = require('react');
+    
+    interface PoisonedProp {
+        x: string;
+        y: 2;
+    }
+    
+    class Poisoned extends React.Component<PoisonedProp, {}> {
+        render() {
+            return <div>Hello</div>;
+        }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+    }
+    
+    let obj = {
+        x: "hello world",
+        y: 2
+    };
+    
+    // Error as "obj" has type { x: string; y: number }
+    let p = <Poisoned {...obj} />;
+                      ~~~~~~~~
+!!! error TS2322: Type '{ x: string; y: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Poisoned> & PoisonedProp & { children?: ReactNode; }'.
+!!! error TS2322:   Type '{ x: string; y: number; }' is not assignable to type 'PoisonedProp'.
+!!! error TS2322:     Types of property 'y' are incompatible.
+!!! error TS2322:       Type 'number' is not assignable to type '2'.
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution5.js b/tests/baselines/reference/tsxSpreadAttributesResolution5.js
new file mode 100644
index 0000000000000..4225ca180ac16
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution5.js
@@ -0,0 +1,47 @@
+//// [file.tsx]
+
+import React = require('react');
+
+interface PoisonedProp {
+    x: string;
+    y: 2;
+}
+
+class Poisoned extends React.Component<PoisonedProp, {}> {
+    render() {
+        return <div>Hello</div>;
+    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+}
+
+let obj = {
+    x: "hello world",
+    y: 2
+};
+
+// Error as "obj" has type { x: string; y: number }
+let p = <Poisoned {...obj} />;
+
+//// [file.jsx]
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var React = require("react");
+var Poisoned = (function (_super) {
+    __extends(Poisoned, _super);
+    function Poisoned() {
+        return _super.apply(this, arguments) || this;
+    }
+    Poisoned.prototype.render = function () {
+        return <div>Hello</div>;
+    };
+    return Poisoned;
+}(React.Component));
+var obj = {
+    x: "hello world",
+    y: 2
+};
+// Error as "obj" has type { x: string; y: number }
+var p = <Poisoned {...obj}/>;
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution6.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution6.errors.txt
new file mode 100644
index 0000000000000..c3bd7484fbfcc
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution6.errors.txt
@@ -0,0 +1,24 @@
+tests/cases/conformance/jsx/file.tsx(14,10): error TS2600: JSX element attributes type '({ editable: false; } & { children?: ReactNode; }) | ({ editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; })' may not be a union type.
+
+
+==== tests/cases/conformance/jsx/file.tsx (1 errors) ====
+    
+    import React = require('react');
+    
+    type TextProps = { editable: false }
+                   | { editable: true, onEdit: (newText: string) => void };
+    
+    class TextComponent extends React.Component<TextProps, {}> {
+        render() {
+            return <span>Some Text..</span>;
+        }
+    }
+    
+    // Error
+    let x = <TextComponent editable={true} />
+             ~~~~~~~~~~~~~
+!!! error TS2600: JSX element attributes type '({ editable: false; } & { children?: ReactNode; }) | ({ editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; })' may not be a union type.
+    
+    const textProps: TextProps = {
+        editable: false
+    };
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution6.js b/tests/baselines/reference/tsxSpreadAttributesResolution6.js
new file mode 100644
index 0000000000000..0b4e50793db9f
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution6.js
@@ -0,0 +1,43 @@
+//// [file.tsx]
+
+import React = require('react');
+
+type TextProps = { editable: false }
+               | { editable: true, onEdit: (newText: string) => void };
+
+class TextComponent extends React.Component<TextProps, {}> {
+    render() {
+        return <span>Some Text..</span>;
+    }
+}
+
+// Error
+let x = <TextComponent editable={true} />
+
+const textProps: TextProps = {
+    editable: false
+};
+
+//// [file.jsx]
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var React = require("react");
+var TextComponent = (function (_super) {
+    __extends(TextComponent, _super);
+    function TextComponent() {
+        return _super.apply(this, arguments) || this;
+    }
+    TextComponent.prototype.render = function () {
+        return <span>Some Text..</span>;
+    };
+    return TextComponent;
+}(React.Component));
+// Error
+var x = <TextComponent editable={true}/>;
+var textProps = {
+    editable: false
+};
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution7.errors.txt b/tests/baselines/reference/tsxSpreadAttributesResolution7.errors.txt
new file mode 100644
index 0000000000000..c71459c4a381c
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution7.errors.txt
@@ -0,0 +1,34 @@
+tests/cases/conformance/jsx/file.tsx(18,11): error TS2600: JSX element attributes type '({ editable: false; } & { children?: ReactNode; }) | ({ editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; })' may not be a union type.
+tests/cases/conformance/jsx/file.tsx(25,11): error TS2600: JSX element attributes type '({ editable: false; } & { children?: ReactNode; }) | ({ editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; })' may not be a union type.
+
+
+==== tests/cases/conformance/jsx/file.tsx (2 errors) ====
+    
+    import React = require('react');
+    
+    type TextProps = { editable: false }
+                   | { editable: true, onEdit: (newText: string) => void };
+    
+    class TextComponent extends React.Component<TextProps, {}> {
+        render() {
+            return <span>Some Text..</span>;
+        }
+    }
+    
+    // OK
+    const textPropsFalse: TextProps = {
+        editable: false
+    };
+    
+    let y1 = <TextComponent {...textPropsFalse} />
+              ~~~~~~~~~~~~~
+!!! error TS2600: JSX element attributes type '({ editable: false; } & { children?: ReactNode; }) | ({ editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; })' may not be a union type.
+    
+    const textPropsTrue: TextProps = {
+        editable: true,
+        onEdit: () => {}
+    };
+    
+    let y2 = <TextComponent {...textPropsTrue} />
+              ~~~~~~~~~~~~~
+!!! error TS2600: JSX element attributes type '({ editable: false; } & { children?: ReactNode; }) | ({ editable: true; onEdit: (newText: string) => void; } & { children?: ReactNode; })' may not be a union type.
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution7.js b/tests/baselines/reference/tsxSpreadAttributesResolution7.js
new file mode 100644
index 0000000000000..47ee5ef15ed8b
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution7.js
@@ -0,0 +1,55 @@
+//// [file.tsx]
+
+import React = require('react');
+
+type TextProps = { editable: false }
+               | { editable: true, onEdit: (newText: string) => void };
+
+class TextComponent extends React.Component<TextProps, {}> {
+    render() {
+        return <span>Some Text..</span>;
+    }
+}
+
+// OK
+const textPropsFalse: TextProps = {
+    editable: false
+};
+
+let y1 = <TextComponent {...textPropsFalse} />
+
+const textPropsTrue: TextProps = {
+    editable: true,
+    onEdit: () => {}
+};
+
+let y2 = <TextComponent {...textPropsTrue} />
+
+//// [file.jsx]
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var React = require("react");
+var TextComponent = (function (_super) {
+    __extends(TextComponent, _super);
+    function TextComponent() {
+        return _super.apply(this, arguments) || this;
+    }
+    TextComponent.prototype.render = function () {
+        return <span>Some Text..</span>;
+    };
+    return TextComponent;
+}(React.Component));
+// OK
+var textPropsFalse = {
+    editable: false
+};
+var y1 = <TextComponent {...textPropsFalse}/>;
+var textPropsTrue = {
+    editable: true,
+    onEdit: function () { }
+};
+var y2 = <TextComponent {...textPropsTrue}/>;
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution7.symbols b/tests/baselines/reference/tsxSpreadAttributesResolution7.symbols
new file mode 100644
index 0000000000000..f40b79ae6166d
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution7.symbols
@@ -0,0 +1,62 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+
+type TextProps = { editable: false }
+>TextProps : Symbol(TextProps, Decl(file.tsx, 1, 32))
+>editable : Symbol(editable, Decl(file.tsx, 3, 18))
+
+               | { editable: true, onEdit: (newText: string) => void };
+>editable : Symbol(editable, Decl(file.tsx, 4, 18))
+>onEdit : Symbol(onEdit, Decl(file.tsx, 4, 34))
+>newText : Symbol(newText, Decl(file.tsx, 4, 44))
+
+class TextComponent extends React.Component<TextProps, {}> {
+>TextComponent : Symbol(TextComponent, Decl(file.tsx, 4, 71))
+>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>TextProps : Symbol(TextProps, Decl(file.tsx, 1, 32))
+
+    render() {
+>render : Symbol(TextComponent.render, Decl(file.tsx, 6, 60))
+
+        return <span>Some Text..</span>;
+>span : Symbol(JSX.IntrinsicElements.span, Decl(react.d.ts, 2458, 51))
+>span : Symbol(JSX.IntrinsicElements.span, Decl(react.d.ts, 2458, 51))
+    }
+}
+
+// OK
+const textPropsFalse: TextProps = {
+>textPropsFalse : Symbol(textPropsFalse, Decl(file.tsx, 13, 5))
+>TextProps : Symbol(TextProps, Decl(file.tsx, 1, 32))
+
+    editable: false
+>editable : Symbol(editable, Decl(file.tsx, 13, 35))
+
+};
+
+let y1 = <TextComponent {...textPropsFalse} />
+>y1 : Symbol(y1, Decl(file.tsx, 17, 3))
+>TextComponent : Symbol(TextComponent, Decl(file.tsx, 4, 71))
+>textPropsFalse : Symbol(textPropsFalse, Decl(file.tsx, 13, 5))
+
+const textPropsTrue: TextProps = {
+>textPropsTrue : Symbol(textPropsTrue, Decl(file.tsx, 19, 5))
+>TextProps : Symbol(TextProps, Decl(file.tsx, 1, 32))
+
+    editable: true,
+>editable : Symbol(editable, Decl(file.tsx, 19, 34))
+
+    onEdit: () => {}
+>onEdit : Symbol(onEdit, Decl(file.tsx, 20, 19))
+
+};
+
+let y2 = <TextComponent {...textPropsTrue} />
+>y2 : Symbol(y2, Decl(file.tsx, 24, 3))
+>TextComponent : Symbol(TextComponent, Decl(file.tsx, 4, 71))
+>textPropsTrue : Symbol(textPropsTrue, Decl(file.tsx, 19, 5))
+
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution7.types b/tests/baselines/reference/tsxSpreadAttributesResolution7.types
new file mode 100644
index 0000000000000..db423de090486
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution7.types
@@ -0,0 +1,72 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : typeof React
+
+type TextProps = { editable: false }
+>TextProps : { editable: false; } | { editable: true; onEdit: (newText: string) => void; }
+>editable : false
+>false : false
+
+               | { editable: true, onEdit: (newText: string) => void };
+>editable : true
+>true : true
+>onEdit : (newText: string) => void
+>newText : string
+
+class TextComponent extends React.Component<TextProps, {}> {
+>TextComponent : TextComponent
+>React.Component : React.Component<{ editable: false; } | { editable: true; onEdit: (newText: string) => void; }, {}>
+>React : typeof React
+>Component : typeof React.Component
+>TextProps : { editable: false; } | { editable: true; onEdit: (newText: string) => void; }
+
+    render() {
+>render : () => JSX.Element
+
+        return <span>Some Text..</span>;
+><span>Some Text..</span> : JSX.Element
+>span : any
+>span : any
+    }
+}
+
+// OK
+const textPropsFalse: TextProps = {
+>textPropsFalse : { editable: false; } | { editable: true; onEdit: (newText: string) => void; }
+>TextProps : { editable: false; } | { editable: true; onEdit: (newText: string) => void; }
+>{    editable: false} : { editable: false; }
+
+    editable: false
+>editable : boolean
+>false : false
+
+};
+
+let y1 = <TextComponent {...textPropsFalse} />
+>y1 : JSX.Element
+><TextComponent {...textPropsFalse} /> : JSX.Element
+>TextComponent : typeof TextComponent
+>textPropsFalse : { editable: false; }
+
+const textPropsTrue: TextProps = {
+>textPropsTrue : { editable: false; } | { editable: true; onEdit: (newText: string) => void; }
+>TextProps : { editable: false; } | { editable: true; onEdit: (newText: string) => void; }
+>{    editable: true,    onEdit: () => {}} : { editable: true; onEdit: () => void; }
+
+    editable: true,
+>editable : boolean
+>true : true
+
+    onEdit: () => {}
+>onEdit : () => void
+>() => {} : () => void
+
+};
+
+let y2 = <TextComponent {...textPropsTrue} />
+>y2 : JSX.Element
+><TextComponent {...textPropsTrue} /> : JSX.Element
+>TextComponent : typeof TextComponent
+>textPropsTrue : { editable: true; onEdit: (newText: string) => void; }
+
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution8.js b/tests/baselines/reference/tsxSpreadAttributesResolution8.js
new file mode 100644
index 0000000000000..188c89fb21dd5
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution8.js
@@ -0,0 +1,58 @@
+//// [file.tsx]
+
+import React = require('react');
+
+const obj = {};
+const obj1 = {
+    x: 2
+}
+const obj3 = {
+    y: true,
+    overwrite: "hi"
+}
+
+interface Prop {
+    x: number
+    y: boolean
+    overwrite: string
+}
+
+class OverWriteAttr extends React.Component<Prop, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+// OK
+let x = <OverWriteAttr {...obj} y overwrite="hi" {...obj1} />
+let x1 = <OverWriteAttr {...obj1} {...obj3}  />
+
+//// [file.jsx]
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var React = require("react");
+var obj = {};
+var obj1 = {
+    x: 2
+};
+var obj3 = {
+    y: true,
+    overwrite: "hi"
+};
+var OverWriteAttr = (function (_super) {
+    __extends(OverWriteAttr, _super);
+    function OverWriteAttr() {
+        return _super.apply(this, arguments) || this;
+    }
+    OverWriteAttr.prototype.render = function () {
+        return <div>Hello</div>;
+    };
+    return OverWriteAttr;
+}(React.Component));
+// OK
+var x = <OverWriteAttr {...obj} y overwrite="hi" {...obj1}/>;
+var x1 = <OverWriteAttr {...obj1} {...obj3}/>;
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution8.symbols b/tests/baselines/reference/tsxSpreadAttributesResolution8.symbols
new file mode 100644
index 0000000000000..6a9f9c05fce2d
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution8.symbols
@@ -0,0 +1,68 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+
+const obj = {};
+>obj : Symbol(obj, Decl(file.tsx, 3, 5))
+
+const obj1 = {
+>obj1 : Symbol(obj1, Decl(file.tsx, 4, 5))
+
+    x: 2
+>x : Symbol(x, Decl(file.tsx, 4, 14))
+}
+const obj3 = {
+>obj3 : Symbol(obj3, Decl(file.tsx, 7, 5))
+
+    y: true,
+>y : Symbol(y, Decl(file.tsx, 7, 14))
+
+    overwrite: "hi"
+>overwrite : Symbol(overwrite, Decl(file.tsx, 8, 12))
+}
+
+interface Prop {
+>Prop : Symbol(Prop, Decl(file.tsx, 10, 1))
+
+    x: number
+>x : Symbol(Prop.x, Decl(file.tsx, 12, 16))
+
+    y: boolean
+>y : Symbol(Prop.y, Decl(file.tsx, 13, 13))
+
+    overwrite: string
+>overwrite : Symbol(Prop.overwrite, Decl(file.tsx, 14, 14))
+}
+
+class OverWriteAttr extends React.Component<Prop, {}> {
+>OverWriteAttr : Symbol(OverWriteAttr, Decl(file.tsx, 16, 1))
+>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>Prop : Symbol(Prop, Decl(file.tsx, 10, 1))
+
+    render() {
+>render : Symbol(OverWriteAttr.render, Decl(file.tsx, 18, 55))
+
+        return <div>Hello</div>;
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
+    }
+}
+
+// OK
+let x = <OverWriteAttr {...obj} y overwrite="hi" {...obj1} />
+>x : Symbol(x, Decl(file.tsx, 25, 3))
+>OverWriteAttr : Symbol(OverWriteAttr, Decl(file.tsx, 16, 1))
+>obj : Symbol(obj, Decl(file.tsx, 3, 5))
+>y : Symbol(y, Decl(file.tsx, 25, 31))
+>overwrite : Symbol(overwrite, Decl(file.tsx, 25, 33))
+>obj1 : Symbol(obj1, Decl(file.tsx, 4, 5))
+
+let x1 = <OverWriteAttr {...obj1} {...obj3}  />
+>x1 : Symbol(x1, Decl(file.tsx, 26, 3))
+>OverWriteAttr : Symbol(OverWriteAttr, Decl(file.tsx, 16, 1))
+>obj1 : Symbol(obj1, Decl(file.tsx, 4, 5))
+>obj3 : Symbol(obj3, Decl(file.tsx, 7, 5))
+
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution8.types b/tests/baselines/reference/tsxSpreadAttributesResolution8.types
new file mode 100644
index 0000000000000..dcf13976a0e4e
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution8.types
@@ -0,0 +1,77 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : typeof React
+
+const obj = {};
+>obj : {}
+>{} : {}
+
+const obj1 = {
+>obj1 : { x: number; }
+>{    x: 2} : { x: number; }
+
+    x: 2
+>x : number
+>2 : 2
+}
+const obj3 = {
+>obj3 : { y: boolean; overwrite: string; }
+>{    y: true,    overwrite: "hi"} : { y: boolean; overwrite: string; }
+
+    y: true,
+>y : boolean
+>true : true
+
+    overwrite: "hi"
+>overwrite : string
+>"hi" : "hi"
+}
+
+interface Prop {
+>Prop : Prop
+
+    x: number
+>x : number
+
+    y: boolean
+>y : boolean
+
+    overwrite: string
+>overwrite : string
+}
+
+class OverWriteAttr extends React.Component<Prop, {}> {
+>OverWriteAttr : OverWriteAttr
+>React.Component : React.Component<Prop, {}>
+>React : typeof React
+>Component : typeof React.Component
+>Prop : Prop
+
+    render() {
+>render : () => JSX.Element
+
+        return <div>Hello</div>;
+><div>Hello</div> : JSX.Element
+>div : any
+>div : any
+    }
+}
+
+// OK
+let x = <OverWriteAttr {...obj} y overwrite="hi" {...obj1} />
+>x : JSX.Element
+><OverWriteAttr {...obj} y overwrite="hi" {...obj1} /> : JSX.Element
+>OverWriteAttr : typeof OverWriteAttr
+>obj : {}
+>y : true
+>overwrite : string
+>obj1 : { x: number; }
+
+let x1 = <OverWriteAttr {...obj1} {...obj3}  />
+>x1 : JSX.Element
+><OverWriteAttr {...obj1} {...obj3}  /> : JSX.Element
+>OverWriteAttr : typeof OverWriteAttr
+>obj1 : { x: number; }
+>obj3 : { y: boolean; overwrite: string; }
+
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution9.js b/tests/baselines/reference/tsxSpreadAttributesResolution9.js
new file mode 100644
index 0000000000000..1ef5d08175355
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution9.js
@@ -0,0 +1,55 @@
+//// [file.tsx]
+
+import React = require('react');
+
+interface OptionProp {
+    x?: 2
+    y?: boolean
+}
+
+class Opt extends React.Component<OptionProp, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+const obj: OptionProp = {};
+const obj1: OptionProp = {
+    x: 2
+}
+
+// OK
+let p = <Opt />;
+let y = <Opt {...obj} />;
+let y1 = <Opt {...obj1} />;
+let y2 = <Opt {...obj1} y/>;
+let y3 = <Opt x={2} />;
+
+//// [file.jsx]
+"use strict";
+var __extends = (this && this.__extends) || function (d, b) {
+    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+    function __() { this.constructor = d; }
+    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+};
+var React = require("react");
+var Opt = (function (_super) {
+    __extends(Opt, _super);
+    function Opt() {
+        return _super.apply(this, arguments) || this;
+    }
+    Opt.prototype.render = function () {
+        return <div>Hello</div>;
+    };
+    return Opt;
+}(React.Component));
+var obj = {};
+var obj1 = {
+    x: 2
+};
+// OK
+var p = <Opt />;
+var y = <Opt {...obj}/>;
+var y1 = <Opt {...obj1}/>;
+var y2 = <Opt {...obj1} y/>;
+var y3 = <Opt x={2}/>;
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution9.symbols b/tests/baselines/reference/tsxSpreadAttributesResolution9.symbols
new file mode 100644
index 0000000000000..e58e92cd29a65
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution9.symbols
@@ -0,0 +1,69 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+
+interface OptionProp {
+>OptionProp : Symbol(OptionProp, Decl(file.tsx, 1, 32))
+
+    x?: 2
+>x : Symbol(OptionProp.x, Decl(file.tsx, 3, 22))
+
+    y?: boolean
+>y : Symbol(OptionProp.y, Decl(file.tsx, 4, 9))
+}
+
+class Opt extends React.Component<OptionProp, {}> {
+>Opt : Symbol(Opt, Decl(file.tsx, 6, 1))
+>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
+>OptionProp : Symbol(OptionProp, Decl(file.tsx, 1, 32))
+
+    render() {
+>render : Symbol(Opt.render, Decl(file.tsx, 8, 51))
+
+        return <div>Hello</div>;
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
+    }
+}
+
+const obj: OptionProp = {};
+>obj : Symbol(obj, Decl(file.tsx, 14, 5))
+>OptionProp : Symbol(OptionProp, Decl(file.tsx, 1, 32))
+
+const obj1: OptionProp = {
+>obj1 : Symbol(obj1, Decl(file.tsx, 15, 5))
+>OptionProp : Symbol(OptionProp, Decl(file.tsx, 1, 32))
+
+    x: 2
+>x : Symbol(x, Decl(file.tsx, 15, 26))
+}
+
+// OK
+let p = <Opt />;
+>p : Symbol(p, Decl(file.tsx, 20, 3))
+>Opt : Symbol(Opt, Decl(file.tsx, 6, 1))
+
+let y = <Opt {...obj} />;
+>y : Symbol(y, Decl(file.tsx, 21, 3))
+>Opt : Symbol(Opt, Decl(file.tsx, 6, 1))
+>obj : Symbol(obj, Decl(file.tsx, 14, 5))
+
+let y1 = <Opt {...obj1} />;
+>y1 : Symbol(y1, Decl(file.tsx, 22, 3))
+>Opt : Symbol(Opt, Decl(file.tsx, 6, 1))
+>obj1 : Symbol(obj1, Decl(file.tsx, 15, 5))
+
+let y2 = <Opt {...obj1} y/>;
+>y2 : Symbol(y2, Decl(file.tsx, 23, 3))
+>Opt : Symbol(Opt, Decl(file.tsx, 6, 1))
+>obj1 : Symbol(obj1, Decl(file.tsx, 15, 5))
+>y : Symbol(y, Decl(file.tsx, 23, 23))
+
+let y3 = <Opt x={2} />;
+>y3 : Symbol(y3, Decl(file.tsx, 24, 3))
+>Opt : Symbol(Opt, Decl(file.tsx, 6, 1))
+>x : Symbol(x, Decl(file.tsx, 24, 13))
+
diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution9.types b/tests/baselines/reference/tsxSpreadAttributesResolution9.types
new file mode 100644
index 0000000000000..ccc84af648841
--- /dev/null
+++ b/tests/baselines/reference/tsxSpreadAttributesResolution9.types
@@ -0,0 +1,79 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react');
+>React : typeof React
+
+interface OptionProp {
+>OptionProp : OptionProp
+
+    x?: 2
+>x : 2
+
+    y?: boolean
+>y : boolean
+}
+
+class Opt extends React.Component<OptionProp, {}> {
+>Opt : Opt
+>React.Component : React.Component<OptionProp, {}>
+>React : typeof React
+>Component : typeof React.Component
+>OptionProp : OptionProp
+
+    render() {
+>render : () => JSX.Element
+
+        return <div>Hello</div>;
+><div>Hello</div> : JSX.Element
+>div : any
+>div : any
+    }
+}
+
+const obj: OptionProp = {};
+>obj : OptionProp
+>OptionProp : OptionProp
+>{} : {}
+
+const obj1: OptionProp = {
+>obj1 : OptionProp
+>OptionProp : OptionProp
+>{    x: 2} : { x: 2; }
+
+    x: 2
+>x : number
+>2 : 2
+}
+
+// OK
+let p = <Opt />;
+>p : JSX.Element
+><Opt /> : JSX.Element
+>Opt : typeof Opt
+
+let y = <Opt {...obj} />;
+>y : JSX.Element
+><Opt {...obj} /> : JSX.Element
+>Opt : typeof Opt
+>obj : OptionProp
+
+let y1 = <Opt {...obj1} />;
+>y1 : JSX.Element
+><Opt {...obj1} /> : JSX.Element
+>Opt : typeof Opt
+>obj1 : OptionProp
+
+let y2 = <Opt {...obj1} y/>;
+>y2 : JSX.Element
+><Opt {...obj1} y/> : JSX.Element
+>Opt : typeof Opt
+>obj1 : OptionProp
+>y : true
+
+let y3 = <Opt x={2} />;
+>y3 : JSX.Element
+><Opt x={2} /> : JSX.Element
+>Opt : typeof Opt
+>x : number
+>2 : 2
+
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload1.js b/tests/baselines/reference/tsxStatelessFunctionComponentOverload1.js
new file mode 100644
index 0000000000000..4b3d582f6ccf5
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload1.js
@@ -0,0 +1,64 @@
+//// [file.tsx]
+
+import React = require('react')
+
+declare function OneThing(k: {yxx: string}): JSX.Element;
+declare function OneThing(l: {yy: number, yy1: string}): JSX.Element;
+declare function OneThing(l: {yy: number, yy1: string, yy2: boolean}): JSX.Element;
+declare function OneThing(l1: {data: string, "data-prop": boolean}): JSX.Element;
+
+// OK
+const c1 = <OneThing yxx='ok' />
+const c2 = <OneThing yy={100}  yy1="hello"/>
+const c3 = <OneThing yxx="hello" ignore-prop />
+const c4 = <OneThing data="hello" data-prop />
+
+declare function TestingOneThing({y1: string}): JSX.Element;
+declare function TestingOneThing(j: {"extra-data": string, yy?: string}): JSX.Element;
+declare function TestingOneThing(n: {yy: number, direction?: number}): JSX.Element;
+declare function TestingOneThing(n: {yy: string, name: string}): JSX.Element;
+
+// OK
+const d1 = <TestingOneThing y1 extra-data />;
+const d2 = <TestingOneThing extra-data="hello" />;
+const d3 = <TestingOneThing extra-data="hello" yy="hihi" />;
+const d4 = <TestingOneThing extra-data="hello" yy={9} direction={10} />;
+const d5 = <TestingOneThing extra-data="hello" yy="hello" name="Bob" />;
+
+
+declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element;
+declare function TestingOptional(a: {y1: boolean, y2?: number, y3: boolean}): JSX.Element;
+
+// OK
+const e1 = <TestingOptional />
+const e2 = <TestingOptional extra-prop/>
+const e3 = <TestingOptional y1="hello"/>
+const e4 = <TestingOptional y1="hello" y2={1000} />
+const e5 = <TestingOptional y1 y3/>
+const e6 = <TestingOptional y1 y3 y2={10} />
+
+
+
+
+//// [file.jsx]
+define(["require", "exports", "react"], function (require, exports, React) {
+    "use strict";
+    // OK
+    var c1 = <OneThing yxx='ok'/>;
+    var c2 = <OneThing yy={100} yy1="hello"/>;
+    var c3 = <OneThing yxx="hello" ignore-prop/>;
+    var c4 = <OneThing data="hello" data-prop/>;
+    // OK
+    var d1 = <TestingOneThing y1 extra-data/>;
+    var d2 = <TestingOneThing extra-data="hello"/>;
+    var d3 = <TestingOneThing extra-data="hello" yy="hihi"/>;
+    var d4 = <TestingOneThing extra-data="hello" yy={9} direction={10}/>;
+    var d5 = <TestingOneThing extra-data="hello" yy="hello" name="Bob"/>;
+    // OK
+    var e1 = <TestingOptional />;
+    var e2 = <TestingOptional extra-prop/>;
+    var e3 = <TestingOptional y1="hello"/>;
+    var e4 = <TestingOptional y1="hello" y2={1000}/>;
+    var e5 = <TestingOptional y1 y3/>;
+    var e6 = <TestingOptional y1 y3 y2={10}/>;
+});
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload1.symbols b/tests/baselines/reference/tsxStatelessFunctionComponentOverload1.symbols
new file mode 100644
index 0000000000000..cc559031caae3
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload1.symbols
@@ -0,0 +1,176 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react')
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+
+declare function OneThing(k: {yxx: string}): JSX.Element;
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 57), Decl(file.tsx, 4, 69), Decl(file.tsx, 5, 83))
+>k : Symbol(k, Decl(file.tsx, 3, 26))
+>yxx : Symbol(yxx, Decl(file.tsx, 3, 30))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+declare function OneThing(l: {yy: number, yy1: string}): JSX.Element;
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 57), Decl(file.tsx, 4, 69), Decl(file.tsx, 5, 83))
+>l : Symbol(l, Decl(file.tsx, 4, 26))
+>yy : Symbol(yy, Decl(file.tsx, 4, 30))
+>yy1 : Symbol(yy1, Decl(file.tsx, 4, 41))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+declare function OneThing(l: {yy: number, yy1: string, yy2: boolean}): JSX.Element;
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 57), Decl(file.tsx, 4, 69), Decl(file.tsx, 5, 83))
+>l : Symbol(l, Decl(file.tsx, 5, 26))
+>yy : Symbol(yy, Decl(file.tsx, 5, 30))
+>yy1 : Symbol(yy1, Decl(file.tsx, 5, 41))
+>yy2 : Symbol(yy2, Decl(file.tsx, 5, 54))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+declare function OneThing(l1: {data: string, "data-prop": boolean}): JSX.Element;
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 57), Decl(file.tsx, 4, 69), Decl(file.tsx, 5, 83))
+>l1 : Symbol(l1, Decl(file.tsx, 6, 26))
+>data : Symbol(data, Decl(file.tsx, 6, 31))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+// OK
+const c1 = <OneThing yxx='ok' />
+>c1 : Symbol(c1, Decl(file.tsx, 9, 5))
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 57), Decl(file.tsx, 4, 69), Decl(file.tsx, 5, 83))
+>yxx : Symbol(yxx, Decl(file.tsx, 9, 20))
+
+const c2 = <OneThing yy={100}  yy1="hello"/>
+>c2 : Symbol(c2, Decl(file.tsx, 10, 5))
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 57), Decl(file.tsx, 4, 69), Decl(file.tsx, 5, 83))
+>yy : Symbol(yy, Decl(file.tsx, 10, 20))
+>yy1 : Symbol(yy1, Decl(file.tsx, 10, 29))
+
+const c3 = <OneThing yxx="hello" ignore-prop />
+>c3 : Symbol(c3, Decl(file.tsx, 11, 5))
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 57), Decl(file.tsx, 4, 69), Decl(file.tsx, 5, 83))
+>yxx : Symbol(yxx, Decl(file.tsx, 11, 20))
+>ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 11, 32))
+
+const c4 = <OneThing data="hello" data-prop />
+>c4 : Symbol(c4, Decl(file.tsx, 12, 5))
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 57), Decl(file.tsx, 4, 69), Decl(file.tsx, 5, 83))
+>data : Symbol(data, Decl(file.tsx, 12, 20))
+>data-prop : Symbol(data-prop, Decl(file.tsx, 12, 33))
+
+declare function TestingOneThing({y1: string}): JSX.Element;
+>TestingOneThing : Symbol(TestingOneThing, Decl(file.tsx, 12, 46), Decl(file.tsx, 14, 60), Decl(file.tsx, 15, 86), Decl(file.tsx, 16, 83))
+>y1 : Symbol(y1)
+>string : Symbol(string, Decl(file.tsx, 14, 34))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+declare function TestingOneThing(j: {"extra-data": string, yy?: string}): JSX.Element;
+>TestingOneThing : Symbol(TestingOneThing, Decl(file.tsx, 12, 46), Decl(file.tsx, 14, 60), Decl(file.tsx, 15, 86), Decl(file.tsx, 16, 83))
+>j : Symbol(j, Decl(file.tsx, 15, 33))
+>yy : Symbol(yy, Decl(file.tsx, 15, 58))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+declare function TestingOneThing(n: {yy: number, direction?: number}): JSX.Element;
+>TestingOneThing : Symbol(TestingOneThing, Decl(file.tsx, 12, 46), Decl(file.tsx, 14, 60), Decl(file.tsx, 15, 86), Decl(file.tsx, 16, 83))
+>n : Symbol(n, Decl(file.tsx, 16, 33))
+>yy : Symbol(yy, Decl(file.tsx, 16, 37))
+>direction : Symbol(direction, Decl(file.tsx, 16, 48))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+declare function TestingOneThing(n: {yy: string, name: string}): JSX.Element;
+>TestingOneThing : Symbol(TestingOneThing, Decl(file.tsx, 12, 46), Decl(file.tsx, 14, 60), Decl(file.tsx, 15, 86), Decl(file.tsx, 16, 83))
+>n : Symbol(n, Decl(file.tsx, 17, 33))
+>yy : Symbol(yy, Decl(file.tsx, 17, 37))
+>name : Symbol(name, Decl(file.tsx, 17, 48))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+// OK
+const d1 = <TestingOneThing y1 extra-data />;
+>d1 : Symbol(d1, Decl(file.tsx, 20, 5))
+>TestingOneThing : Symbol(TestingOneThing, Decl(file.tsx, 12, 46), Decl(file.tsx, 14, 60), Decl(file.tsx, 15, 86), Decl(file.tsx, 16, 83))
+>y1 : Symbol(y1, Decl(file.tsx, 20, 27))
+>extra-data : Symbol(extra-data, Decl(file.tsx, 20, 30))
+
+const d2 = <TestingOneThing extra-data="hello" />;
+>d2 : Symbol(d2, Decl(file.tsx, 21, 5))
+>TestingOneThing : Symbol(TestingOneThing, Decl(file.tsx, 12, 46), Decl(file.tsx, 14, 60), Decl(file.tsx, 15, 86), Decl(file.tsx, 16, 83))
+>extra-data : Symbol(extra-data, Decl(file.tsx, 21, 27))
+
+const d3 = <TestingOneThing extra-data="hello" yy="hihi" />;
+>d3 : Symbol(d3, Decl(file.tsx, 22, 5))
+>TestingOneThing : Symbol(TestingOneThing, Decl(file.tsx, 12, 46), Decl(file.tsx, 14, 60), Decl(file.tsx, 15, 86), Decl(file.tsx, 16, 83))
+>extra-data : Symbol(extra-data, Decl(file.tsx, 22, 27))
+>yy : Symbol(yy, Decl(file.tsx, 22, 46))
+
+const d4 = <TestingOneThing extra-data="hello" yy={9} direction={10} />;
+>d4 : Symbol(d4, Decl(file.tsx, 23, 5))
+>TestingOneThing : Symbol(TestingOneThing, Decl(file.tsx, 12, 46), Decl(file.tsx, 14, 60), Decl(file.tsx, 15, 86), Decl(file.tsx, 16, 83))
+>extra-data : Symbol(extra-data, Decl(file.tsx, 23, 27))
+>yy : Symbol(yy, Decl(file.tsx, 23, 46))
+>direction : Symbol(direction, Decl(file.tsx, 23, 53))
+
+const d5 = <TestingOneThing extra-data="hello" yy="hello" name="Bob" />;
+>d5 : Symbol(d5, Decl(file.tsx, 24, 5))
+>TestingOneThing : Symbol(TestingOneThing, Decl(file.tsx, 12, 46), Decl(file.tsx, 14, 60), Decl(file.tsx, 15, 86), Decl(file.tsx, 16, 83))
+>extra-data : Symbol(extra-data, Decl(file.tsx, 24, 27))
+>yy : Symbol(yy, Decl(file.tsx, 24, 46))
+>name : Symbol(name, Decl(file.tsx, 24, 57))
+
+
+declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element;
+>TestingOptional : Symbol(TestingOptional, Decl(file.tsx, 24, 72), Decl(file.tsx, 27, 77))
+>a : Symbol(a, Decl(file.tsx, 27, 33))
+>y1 : Symbol(y1, Decl(file.tsx, 27, 37))
+>y2 : Symbol(y2, Decl(file.tsx, 27, 49))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+declare function TestingOptional(a: {y1: boolean, y2?: number, y3: boolean}): JSX.Element;
+>TestingOptional : Symbol(TestingOptional, Decl(file.tsx, 24, 72), Decl(file.tsx, 27, 77))
+>a : Symbol(a, Decl(file.tsx, 28, 33))
+>y1 : Symbol(y1, Decl(file.tsx, 28, 37))
+>y2 : Symbol(y2, Decl(file.tsx, 28, 49))
+>y3 : Symbol(y3, Decl(file.tsx, 28, 62))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+// OK
+const e1 = <TestingOptional />
+>e1 : Symbol(e1, Decl(file.tsx, 31, 5))
+>TestingOptional : Symbol(TestingOptional, Decl(file.tsx, 24, 72), Decl(file.tsx, 27, 77))
+
+const e2 = <TestingOptional extra-prop/>
+>e2 : Symbol(e2, Decl(file.tsx, 32, 5))
+>TestingOptional : Symbol(TestingOptional, Decl(file.tsx, 24, 72), Decl(file.tsx, 27, 77))
+>extra-prop : Symbol(extra-prop, Decl(file.tsx, 32, 27))
+
+const e3 = <TestingOptional y1="hello"/>
+>e3 : Symbol(e3, Decl(file.tsx, 33, 5))
+>TestingOptional : Symbol(TestingOptional, Decl(file.tsx, 24, 72), Decl(file.tsx, 27, 77))
+>y1 : Symbol(y1, Decl(file.tsx, 33, 27))
+
+const e4 = <TestingOptional y1="hello" y2={1000} />
+>e4 : Symbol(e4, Decl(file.tsx, 34, 5))
+>TestingOptional : Symbol(TestingOptional, Decl(file.tsx, 24, 72), Decl(file.tsx, 27, 77))
+>y1 : Symbol(y1, Decl(file.tsx, 34, 27))
+>y2 : Symbol(y2, Decl(file.tsx, 34, 38))
+
+const e5 = <TestingOptional y1 y3/>
+>e5 : Symbol(e5, Decl(file.tsx, 35, 5))
+>TestingOptional : Symbol(TestingOptional, Decl(file.tsx, 24, 72), Decl(file.tsx, 27, 77))
+>y1 : Symbol(y1, Decl(file.tsx, 35, 27))
+>y3 : Symbol(y3, Decl(file.tsx, 35, 30))
+
+const e6 = <TestingOptional y1 y3 y2={10} />
+>e6 : Symbol(e6, Decl(file.tsx, 36, 5))
+>TestingOptional : Symbol(TestingOptional, Decl(file.tsx, 24, 72), Decl(file.tsx, 27, 77))
+>y1 : Symbol(y1, Decl(file.tsx, 36, 27))
+>y3 : Symbol(y3, Decl(file.tsx, 36, 30))
+>y2 : Symbol(y2, Decl(file.tsx, 36, 33))
+
+
+
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload1.types b/tests/baselines/reference/tsxStatelessFunctionComponentOverload1.types
new file mode 100644
index 0000000000000..a37ac8072301e
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload1.types
@@ -0,0 +1,196 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react')
+>React : typeof React
+
+declare function OneThing(k: {yxx: string}): JSX.Element;
+>OneThing : { (k: { yxx: string; }): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; (l: { yy: number; yy1: string; yy2: boolean; }): JSX.Element; (l1: { data: string; "data-prop": boolean; }): JSX.Element; }
+>k : { yxx: string; }
+>yxx : string
+>JSX : any
+>Element : JSX.Element
+
+declare function OneThing(l: {yy: number, yy1: string}): JSX.Element;
+>OneThing : { (k: { yxx: string; }): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; (l: { yy: number; yy1: string; yy2: boolean; }): JSX.Element; (l1: { data: string; "data-prop": boolean; }): JSX.Element; }
+>l : { yy: number; yy1: string; }
+>yy : number
+>yy1 : string
+>JSX : any
+>Element : JSX.Element
+
+declare function OneThing(l: {yy: number, yy1: string, yy2: boolean}): JSX.Element;
+>OneThing : { (k: { yxx: string; }): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; (l: { yy: number; yy1: string; yy2: boolean; }): JSX.Element; (l1: { data: string; "data-prop": boolean; }): JSX.Element; }
+>l : { yy: number; yy1: string; yy2: boolean; }
+>yy : number
+>yy1 : string
+>yy2 : boolean
+>JSX : any
+>Element : JSX.Element
+
+declare function OneThing(l1: {data: string, "data-prop": boolean}): JSX.Element;
+>OneThing : { (k: { yxx: string; }): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; (l: { yy: number; yy1: string; yy2: boolean; }): JSX.Element; (l1: { data: string; "data-prop": boolean; }): JSX.Element; }
+>l1 : { data: string; "data-prop": boolean; }
+>data : string
+>JSX : any
+>Element : JSX.Element
+
+// OK
+const c1 = <OneThing yxx='ok' />
+>c1 : JSX.Element
+><OneThing yxx='ok' /> : JSX.Element
+>OneThing : { (k: { yxx: string; }): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; (l: { yy: number; yy1: string; yy2: boolean; }): JSX.Element; (l1: { data: string; "data-prop": boolean; }): JSX.Element; }
+>yxx : string
+
+const c2 = <OneThing yy={100}  yy1="hello"/>
+>c2 : JSX.Element
+><OneThing yy={100}  yy1="hello"/> : JSX.Element
+>OneThing : { (k: { yxx: string; }): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; (l: { yy: number; yy1: string; yy2: boolean; }): JSX.Element; (l1: { data: string; "data-prop": boolean; }): JSX.Element; }
+>yy : number
+>100 : 100
+>yy1 : string
+
+const c3 = <OneThing yxx="hello" ignore-prop />
+>c3 : JSX.Element
+><OneThing yxx="hello" ignore-prop /> : JSX.Element
+>OneThing : { (k: { yxx: string; }): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; (l: { yy: number; yy1: string; yy2: boolean; }): JSX.Element; (l1: { data: string; "data-prop": boolean; }): JSX.Element; }
+>yxx : string
+>ignore-prop : true
+
+const c4 = <OneThing data="hello" data-prop />
+>c4 : JSX.Element
+><OneThing data="hello" data-prop /> : JSX.Element
+>OneThing : { (k: { yxx: string; }): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; (l: { yy: number; yy1: string; yy2: boolean; }): JSX.Element; (l1: { data: string; "data-prop": boolean; }): JSX.Element; }
+>data : string
+>data-prop : true
+
+declare function TestingOneThing({y1: string}): JSX.Element;
+>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
+>y1 : any
+>string : any
+>JSX : any
+>Element : JSX.Element
+
+declare function TestingOneThing(j: {"extra-data": string, yy?: string}): JSX.Element;
+>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
+>j : { "extra-data": string; yy?: string; }
+>yy : string
+>JSX : any
+>Element : JSX.Element
+
+declare function TestingOneThing(n: {yy: number, direction?: number}): JSX.Element;
+>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
+>n : { yy: number; direction?: number; }
+>yy : number
+>direction : number
+>JSX : any
+>Element : JSX.Element
+
+declare function TestingOneThing(n: {yy: string, name: string}): JSX.Element;
+>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
+>n : { yy: string; name: string; }
+>yy : string
+>name : string
+>JSX : any
+>Element : JSX.Element
+
+// OK
+const d1 = <TestingOneThing y1 extra-data />;
+>d1 : JSX.Element
+><TestingOneThing y1 extra-data /> : JSX.Element
+>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
+>y1 : true
+>extra-data : true
+
+const d2 = <TestingOneThing extra-data="hello" />;
+>d2 : JSX.Element
+><TestingOneThing extra-data="hello" /> : JSX.Element
+>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
+>extra-data : string
+
+const d3 = <TestingOneThing extra-data="hello" yy="hihi" />;
+>d3 : JSX.Element
+><TestingOneThing extra-data="hello" yy="hihi" /> : JSX.Element
+>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
+>extra-data : string
+>yy : string
+
+const d4 = <TestingOneThing extra-data="hello" yy={9} direction={10} />;
+>d4 : JSX.Element
+><TestingOneThing extra-data="hello" yy={9} direction={10} /> : JSX.Element
+>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
+>extra-data : string
+>yy : number
+>9 : 9
+>direction : number
+>10 : 10
+
+const d5 = <TestingOneThing extra-data="hello" yy="hello" name="Bob" />;
+>d5 : JSX.Element
+><TestingOneThing extra-data="hello" yy="hello" name="Bob" /> : JSX.Element
+>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
+>extra-data : string
+>yy : string
+>name : string
+
+
+declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element;
+>TestingOptional : { (a: { y1?: string; y2?: number; }): JSX.Element; (a: { y1: boolean; y2?: number; y3: boolean; }): JSX.Element; }
+>a : { y1?: string; y2?: number; }
+>y1 : string
+>y2 : number
+>JSX : any
+>Element : JSX.Element
+
+declare function TestingOptional(a: {y1: boolean, y2?: number, y3: boolean}): JSX.Element;
+>TestingOptional : { (a: { y1?: string; y2?: number; }): JSX.Element; (a: { y1: boolean; y2?: number; y3: boolean; }): JSX.Element; }
+>a : { y1: boolean; y2?: number; y3: boolean; }
+>y1 : boolean
+>y2 : number
+>y3 : boolean
+>JSX : any
+>Element : JSX.Element
+
+// OK
+const e1 = <TestingOptional />
+>e1 : JSX.Element
+><TestingOptional /> : JSX.Element
+>TestingOptional : { (a: { y1?: string; y2?: number; }): JSX.Element; (a: { y1: boolean; y2?: number; y3: boolean; }): JSX.Element; }
+
+const e2 = <TestingOptional extra-prop/>
+>e2 : JSX.Element
+><TestingOptional extra-prop/> : JSX.Element
+>TestingOptional : { (a: { y1?: string; y2?: number; }): JSX.Element; (a: { y1: boolean; y2?: number; y3: boolean; }): JSX.Element; }
+>extra-prop : true
+
+const e3 = <TestingOptional y1="hello"/>
+>e3 : JSX.Element
+><TestingOptional y1="hello"/> : JSX.Element
+>TestingOptional : { (a: { y1?: string; y2?: number; }): JSX.Element; (a: { y1: boolean; y2?: number; y3: boolean; }): JSX.Element; }
+>y1 : string
+
+const e4 = <TestingOptional y1="hello" y2={1000} />
+>e4 : JSX.Element
+><TestingOptional y1="hello" y2={1000} /> : JSX.Element
+>TestingOptional : { (a: { y1?: string; y2?: number; }): JSX.Element; (a: { y1: boolean; y2?: number; y3: boolean; }): JSX.Element; }
+>y1 : string
+>y2 : number
+>1000 : 1000
+
+const e5 = <TestingOptional y1 y3/>
+>e5 : JSX.Element
+><TestingOptional y1 y3/> : JSX.Element
+>TestingOptional : { (a: { y1?: string; y2?: number; }): JSX.Element; (a: { y1: boolean; y2?: number; y3: boolean; }): JSX.Element; }
+>y1 : true
+>y3 : true
+
+const e6 = <TestingOptional y1 y3 y2={10} />
+>e6 : JSX.Element
+><TestingOptional y1 y3 y2={10} /> : JSX.Element
+>TestingOptional : { (a: { y1?: string; y2?: number; }): JSX.Element; (a: { y1: boolean; y2?: number; y3: boolean; }): JSX.Element; }
+>y1 : true
+>y3 : true
+>y2 : number
+>10 : 10
+
+
+
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload2.js b/tests/baselines/reference/tsxStatelessFunctionComponentOverload2.js
new file mode 100644
index 0000000000000..b34b8ff3b5015
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload2.js
@@ -0,0 +1,62 @@
+//// [file.tsx]
+
+import React = require('react')
+declare function OneThing(): JSX.Element;
+declare function OneThing(l: {yy: number, yy1: string}): JSX.Element;
+
+let obj = {
+    yy: 10,
+    yy1: "hello"
+}
+
+let obj1 = {
+    yy: true
+}
+
+let obj2 = {
+    yy: 500,
+    "ignore-prop": "hello"
+}
+
+let defaultObj = undefined;
+
+// OK
+const c1 = <OneThing />
+const c2 = <OneThing {...obj}/>
+const c3 = <OneThing {...{}} />
+const c4 = <OneThing {...obj1} {...obj} />
+const c5 = <OneThing {...obj1} yy={42} {...{yy1: "hi"}}/>
+const c6 = <OneThing {...obj1} {...{yy: 10000, yy1: "true"}} />
+const c7 = <OneThing {...defaultObj} yy {...obj} />;  // No error. should pick second overload
+const c8 = <OneThing ignore-prop={100} />
+const c9 = <OneThing {...{ "ignore-prop":200 }} />;
+const c10 = <OneThing {...obj2} yy1="boo" />;
+
+
+//// [file.jsx]
+define(["require", "exports", "react"], function (require, exports, React) {
+    "use strict";
+    var obj = {
+        yy: 10,
+        yy1: "hello"
+    };
+    var obj1 = {
+        yy: true
+    };
+    var obj2 = {
+        yy: 500,
+        "ignore-prop": "hello"
+    };
+    var defaultObj = undefined;
+    // OK
+    var c1 = <OneThing />;
+    var c2 = <OneThing {...obj}/>;
+    var c3 = <OneThing {...{}}/>;
+    var c4 = <OneThing {...obj1} {...obj}/>;
+    var c5 = <OneThing {...obj1} yy={42} {...{ yy1: "hi" }}/>;
+    var c6 = <OneThing {...obj1} {...{ yy: 10000, yy1: "true" }}/>;
+    var c7 = <OneThing {...defaultObj} yy {...obj}/>; // No error. should pick second overload
+    var c8 = <OneThing ignore-prop={100}/>;
+    var c9 = <OneThing {...{ "ignore-prop": 200 }}/>;
+    var c10 = <OneThing {...obj2} yy1="boo"/>;
+});
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload2.symbols b/tests/baselines/reference/tsxStatelessFunctionComponentOverload2.symbols
new file mode 100644
index 0000000000000..6a9b975897282
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload2.symbols
@@ -0,0 +1,104 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react')
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+
+declare function OneThing(): JSX.Element;
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 2, 41))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+declare function OneThing(l: {yy: number, yy1: string}): JSX.Element;
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 2, 41))
+>l : Symbol(l, Decl(file.tsx, 3, 26))
+>yy : Symbol(yy, Decl(file.tsx, 3, 30))
+>yy1 : Symbol(yy1, Decl(file.tsx, 3, 41))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+let obj = {
+>obj : Symbol(obj, Decl(file.tsx, 5, 3))
+
+    yy: 10,
+>yy : Symbol(yy, Decl(file.tsx, 5, 11))
+
+    yy1: "hello"
+>yy1 : Symbol(yy1, Decl(file.tsx, 6, 11))
+}
+
+let obj1 = {
+>obj1 : Symbol(obj1, Decl(file.tsx, 10, 3))
+
+    yy: true
+>yy : Symbol(yy, Decl(file.tsx, 10, 12))
+}
+
+let obj2 = {
+>obj2 : Symbol(obj2, Decl(file.tsx, 14, 3))
+
+    yy: 500,
+>yy : Symbol(yy, Decl(file.tsx, 14, 12))
+
+    "ignore-prop": "hello"
+}
+
+let defaultObj = undefined;
+>defaultObj : Symbol(defaultObj, Decl(file.tsx, 19, 3))
+>undefined : Symbol(undefined)
+
+// OK
+const c1 = <OneThing />
+>c1 : Symbol(c1, Decl(file.tsx, 22, 5))
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 2, 41))
+
+const c2 = <OneThing {...obj}/>
+>c2 : Symbol(c2, Decl(file.tsx, 23, 5))
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 2, 41))
+>obj : Symbol(obj, Decl(file.tsx, 5, 3))
+
+const c3 = <OneThing {...{}} />
+>c3 : Symbol(c3, Decl(file.tsx, 24, 5))
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 2, 41))
+
+const c4 = <OneThing {...obj1} {...obj} />
+>c4 : Symbol(c4, Decl(file.tsx, 25, 5))
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 2, 41))
+>obj1 : Symbol(obj1, Decl(file.tsx, 10, 3))
+>obj : Symbol(obj, Decl(file.tsx, 5, 3))
+
+const c5 = <OneThing {...obj1} yy={42} {...{yy1: "hi"}}/>
+>c5 : Symbol(c5, Decl(file.tsx, 26, 5))
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 2, 41))
+>obj1 : Symbol(obj1, Decl(file.tsx, 10, 3))
+>yy : Symbol(yy, Decl(file.tsx, 26, 30))
+>yy1 : Symbol(yy1, Decl(file.tsx, 26, 44))
+
+const c6 = <OneThing {...obj1} {...{yy: 10000, yy1: "true"}} />
+>c6 : Symbol(c6, Decl(file.tsx, 27, 5))
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 2, 41))
+>obj1 : Symbol(obj1, Decl(file.tsx, 10, 3))
+>yy : Symbol(yy, Decl(file.tsx, 27, 36))
+>yy1 : Symbol(yy1, Decl(file.tsx, 27, 46))
+
+const c7 = <OneThing {...defaultObj} yy {...obj} />;  // No error. should pick second overload
+>c7 : Symbol(c7, Decl(file.tsx, 28, 5))
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 2, 41))
+>defaultObj : Symbol(defaultObj, Decl(file.tsx, 19, 3))
+>yy : Symbol(yy, Decl(file.tsx, 28, 36))
+>obj : Symbol(obj, Decl(file.tsx, 5, 3))
+
+const c8 = <OneThing ignore-prop={100} />
+>c8 : Symbol(c8, Decl(file.tsx, 29, 5))
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 2, 41))
+>ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 29, 20))
+
+const c9 = <OneThing {...{ "ignore-prop":200 }} />;
+>c9 : Symbol(c9, Decl(file.tsx, 30, 5))
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 2, 41))
+
+const c10 = <OneThing {...obj2} yy1="boo" />;
+>c10 : Symbol(c10, Decl(file.tsx, 31, 5))
+>OneThing : Symbol(OneThing, Decl(file.tsx, 1, 31), Decl(file.tsx, 2, 41))
+>obj2 : Symbol(obj2, Decl(file.tsx, 14, 3))
+>yy1 : Symbol(yy1, Decl(file.tsx, 31, 31))
+
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload2.types b/tests/baselines/reference/tsxStatelessFunctionComponentOverload2.types
new file mode 100644
index 0000000000000..3736f3b999199
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload2.types
@@ -0,0 +1,132 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react')
+>React : typeof React
+
+declare function OneThing(): JSX.Element;
+>OneThing : { (): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; }
+>JSX : any
+>Element : JSX.Element
+
+declare function OneThing(l: {yy: number, yy1: string}): JSX.Element;
+>OneThing : { (): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; }
+>l : { yy: number; yy1: string; }
+>yy : number
+>yy1 : string
+>JSX : any
+>Element : JSX.Element
+
+let obj = {
+>obj : { yy: number; yy1: string; }
+>{    yy: 10,    yy1: "hello"} : { yy: number; yy1: string; }
+
+    yy: 10,
+>yy : number
+>10 : 10
+
+    yy1: "hello"
+>yy1 : string
+>"hello" : "hello"
+}
+
+let obj1 = {
+>obj1 : { yy: boolean; }
+>{    yy: true} : { yy: boolean; }
+
+    yy: true
+>yy : boolean
+>true : true
+}
+
+let obj2 = {
+>obj2 : { yy: number; "ignore-prop": string; }
+>{    yy: 500,    "ignore-prop": "hello"} : { yy: number; "ignore-prop": string; }
+
+    yy: 500,
+>yy : number
+>500 : 500
+
+    "ignore-prop": "hello"
+>"hello" : "hello"
+}
+
+let defaultObj = undefined;
+>defaultObj : any
+>undefined : undefined
+
+// OK
+const c1 = <OneThing />
+>c1 : JSX.Element
+><OneThing /> : JSX.Element
+>OneThing : { (): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; }
+
+const c2 = <OneThing {...obj}/>
+>c2 : JSX.Element
+><OneThing {...obj}/> : JSX.Element
+>OneThing : { (): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; }
+>obj : { yy: number; yy1: string; }
+
+const c3 = <OneThing {...{}} />
+>c3 : JSX.Element
+><OneThing {...{}} /> : JSX.Element
+>OneThing : { (): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; }
+>{} : {}
+
+const c4 = <OneThing {...obj1} {...obj} />
+>c4 : JSX.Element
+><OneThing {...obj1} {...obj} /> : JSX.Element
+>OneThing : { (): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; }
+>obj1 : { yy: boolean; }
+>obj : { yy: number; yy1: string; }
+
+const c5 = <OneThing {...obj1} yy={42} {...{yy1: "hi"}}/>
+>c5 : JSX.Element
+><OneThing {...obj1} yy={42} {...{yy1: "hi"}}/> : JSX.Element
+>OneThing : { (): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; }
+>obj1 : { yy: boolean; }
+>yy : number
+>42 : 42
+>{yy1: "hi"} : { yy1: string; }
+>yy1 : string
+>"hi" : "hi"
+
+const c6 = <OneThing {...obj1} {...{yy: 10000, yy1: "true"}} />
+>c6 : JSX.Element
+><OneThing {...obj1} {...{yy: 10000, yy1: "true"}} /> : JSX.Element
+>OneThing : { (): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; }
+>obj1 : { yy: boolean; }
+>{yy: 10000, yy1: "true"} : { yy: number; yy1: string; }
+>yy : number
+>10000 : 10000
+>yy1 : string
+>"true" : "true"
+
+const c7 = <OneThing {...defaultObj} yy {...obj} />;  // No error. should pick second overload
+>c7 : JSX.Element
+><OneThing {...defaultObj} yy {...obj} /> : JSX.Element
+>OneThing : { (): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; }
+>defaultObj : undefined
+>yy : true
+>obj : { yy: number; yy1: string; }
+
+const c8 = <OneThing ignore-prop={100} />
+>c8 : JSX.Element
+><OneThing ignore-prop={100} /> : JSX.Element
+>OneThing : { (): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; }
+>ignore-prop : number
+>100 : 100
+
+const c9 = <OneThing {...{ "ignore-prop":200 }} />;
+>c9 : JSX.Element
+><OneThing {...{ "ignore-prop":200 }} /> : JSX.Element
+>OneThing : { (): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; }
+>{ "ignore-prop":200 } : { "ignore-prop": number; }
+>200 : 200
+
+const c10 = <OneThing {...obj2} yy1="boo" />;
+>c10 : JSX.Element
+><OneThing {...obj2} yy1="boo" /> : JSX.Element
+>OneThing : { (): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; }
+>obj2 : { yy: number; "ignore-prop": string; }
+>yy1 : string
+
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload3.js b/tests/baselines/reference/tsxStatelessFunctionComponentOverload3.js
new file mode 100644
index 0000000000000..4a810834e0b8d
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload3.js
@@ -0,0 +1,38 @@
+//// [file.tsx]
+
+interface Context {
+    color: any;
+}
+declare function ZeroThingOrTwoThing(): JSX.Element;
+declare function ZeroThingOrTwoThing(l: {yy: number, yy1: string}, context: Context): JSX.Element;
+
+let obj2 = undefined;
+
+// OK
+const two1 = <ZeroThingOrTwoThing />;
+const two2 = <ZeroThingOrTwoThing yy={100}  yy1="hello"/>;
+const two3 = <ZeroThingOrTwoThing {...obj2} />;  // it is just any so we allow it to pass through
+const two4 = <ZeroThingOrTwoThing  yy={1000} {...obj2} />;  // it is just any so we allow it to pass through
+const two5 = <ZeroThingOrTwoThing  {...obj2} yy={1000} />;  // it is just any so we allow it to pass through
+
+declare function ThreeThing(l: {y1: string}): JSX.Element;
+declare function ThreeThing(l: {y2: string}): JSX.Element;
+declare function ThreeThing(l: {yy: number, yy1: string}, context: Context, updater: any): JSX.Element;
+
+// OK
+const three1 = <ThreeThing yy={99} yy1="hello world" />;
+const three2 = <ThreeThing y2="Bye" />;
+const three3 = <ThreeThing {...obj2} y2={10} />;  // it is just any so we allow it to pass through
+
+//// [file.jsx]
+var obj2 = undefined;
+// OK
+var two1 = <ZeroThingOrTwoThing />;
+var two2 = <ZeroThingOrTwoThing yy={100} yy1="hello"/>;
+var two3 = <ZeroThingOrTwoThing {...obj2}/>; // it is just any so we allow it to pass through
+var two4 = <ZeroThingOrTwoThing yy={1000} {...obj2}/>; // it is just any so we allow it to pass through
+var two5 = <ZeroThingOrTwoThing {...obj2} yy={1000}/>; // it is just any so we allow it to pass through
+// OK
+var three1 = <ThreeThing yy={99} yy1="hello world"/>;
+var three2 = <ThreeThing y2="Bye"/>;
+var three3 = <ThreeThing {...obj2} y2={10}/>; // it is just any so we allow it to pass through
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload3.symbols b/tests/baselines/reference/tsxStatelessFunctionComponentOverload3.symbols
new file mode 100644
index 0000000000000..de5aaa25972d5
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload3.symbols
@@ -0,0 +1,98 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+interface Context {
+>Context : Symbol(Context, Decl(file.tsx, 0, 0))
+
+    color: any;
+>color : Symbol(Context.color, Decl(file.tsx, 1, 19))
+}
+declare function ZeroThingOrTwoThing(): JSX.Element;
+>ZeroThingOrTwoThing : Symbol(ZeroThingOrTwoThing, Decl(file.tsx, 3, 1), Decl(file.tsx, 4, 52))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+declare function ZeroThingOrTwoThing(l: {yy: number, yy1: string}, context: Context): JSX.Element;
+>ZeroThingOrTwoThing : Symbol(ZeroThingOrTwoThing, Decl(file.tsx, 3, 1), Decl(file.tsx, 4, 52))
+>l : Symbol(l, Decl(file.tsx, 5, 37))
+>yy : Symbol(yy, Decl(file.tsx, 5, 41))
+>yy1 : Symbol(yy1, Decl(file.tsx, 5, 52))
+>context : Symbol(context, Decl(file.tsx, 5, 66))
+>Context : Symbol(Context, Decl(file.tsx, 0, 0))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+let obj2 = undefined;
+>obj2 : Symbol(obj2, Decl(file.tsx, 7, 3))
+>undefined : Symbol(undefined)
+
+// OK
+const two1 = <ZeroThingOrTwoThing />;
+>two1 : Symbol(two1, Decl(file.tsx, 10, 5))
+>ZeroThingOrTwoThing : Symbol(ZeroThingOrTwoThing, Decl(file.tsx, 3, 1), Decl(file.tsx, 4, 52))
+
+const two2 = <ZeroThingOrTwoThing yy={100}  yy1="hello"/>;
+>two2 : Symbol(two2, Decl(file.tsx, 11, 5))
+>ZeroThingOrTwoThing : Symbol(ZeroThingOrTwoThing, Decl(file.tsx, 3, 1), Decl(file.tsx, 4, 52))
+>yy : Symbol(yy, Decl(file.tsx, 11, 33))
+>yy1 : Symbol(yy1, Decl(file.tsx, 11, 42))
+
+const two3 = <ZeroThingOrTwoThing {...obj2} />;  // it is just any so we allow it to pass through
+>two3 : Symbol(two3, Decl(file.tsx, 12, 5))
+>ZeroThingOrTwoThing : Symbol(ZeroThingOrTwoThing, Decl(file.tsx, 3, 1), Decl(file.tsx, 4, 52))
+>obj2 : Symbol(obj2, Decl(file.tsx, 7, 3))
+
+const two4 = <ZeroThingOrTwoThing  yy={1000} {...obj2} />;  // it is just any so we allow it to pass through
+>two4 : Symbol(two4, Decl(file.tsx, 13, 5))
+>ZeroThingOrTwoThing : Symbol(ZeroThingOrTwoThing, Decl(file.tsx, 3, 1), Decl(file.tsx, 4, 52))
+>yy : Symbol(yy, Decl(file.tsx, 13, 33))
+>obj2 : Symbol(obj2, Decl(file.tsx, 7, 3))
+
+const two5 = <ZeroThingOrTwoThing  {...obj2} yy={1000} />;  // it is just any so we allow it to pass through
+>two5 : Symbol(two5, Decl(file.tsx, 14, 5))
+>ZeroThingOrTwoThing : Symbol(ZeroThingOrTwoThing, Decl(file.tsx, 3, 1), Decl(file.tsx, 4, 52))
+>obj2 : Symbol(obj2, Decl(file.tsx, 7, 3))
+>yy : Symbol(yy, Decl(file.tsx, 14, 44))
+
+declare function ThreeThing(l: {y1: string}): JSX.Element;
+>ThreeThing : Symbol(ThreeThing, Decl(file.tsx, 14, 58), Decl(file.tsx, 16, 58), Decl(file.tsx, 17, 58))
+>l : Symbol(l, Decl(file.tsx, 16, 28))
+>y1 : Symbol(y1, Decl(file.tsx, 16, 32))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+declare function ThreeThing(l: {y2: string}): JSX.Element;
+>ThreeThing : Symbol(ThreeThing, Decl(file.tsx, 14, 58), Decl(file.tsx, 16, 58), Decl(file.tsx, 17, 58))
+>l : Symbol(l, Decl(file.tsx, 17, 28))
+>y2 : Symbol(y2, Decl(file.tsx, 17, 32))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+declare function ThreeThing(l: {yy: number, yy1: string}, context: Context, updater: any): JSX.Element;
+>ThreeThing : Symbol(ThreeThing, Decl(file.tsx, 14, 58), Decl(file.tsx, 16, 58), Decl(file.tsx, 17, 58))
+>l : Symbol(l, Decl(file.tsx, 18, 28))
+>yy : Symbol(yy, Decl(file.tsx, 18, 32))
+>yy1 : Symbol(yy1, Decl(file.tsx, 18, 43))
+>context : Symbol(context, Decl(file.tsx, 18, 57))
+>Context : Symbol(Context, Decl(file.tsx, 0, 0))
+>updater : Symbol(updater, Decl(file.tsx, 18, 75))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+// OK
+const three1 = <ThreeThing yy={99} yy1="hello world" />;
+>three1 : Symbol(three1, Decl(file.tsx, 21, 5))
+>ThreeThing : Symbol(ThreeThing, Decl(file.tsx, 14, 58), Decl(file.tsx, 16, 58), Decl(file.tsx, 17, 58))
+>yy : Symbol(yy, Decl(file.tsx, 21, 26))
+>yy1 : Symbol(yy1, Decl(file.tsx, 21, 34))
+
+const three2 = <ThreeThing y2="Bye" />;
+>three2 : Symbol(three2, Decl(file.tsx, 22, 5))
+>ThreeThing : Symbol(ThreeThing, Decl(file.tsx, 14, 58), Decl(file.tsx, 16, 58), Decl(file.tsx, 17, 58))
+>y2 : Symbol(y2, Decl(file.tsx, 22, 26))
+
+const three3 = <ThreeThing {...obj2} y2={10} />;  // it is just any so we allow it to pass through
+>three3 : Symbol(three3, Decl(file.tsx, 23, 5))
+>ThreeThing : Symbol(ThreeThing, Decl(file.tsx, 14, 58), Decl(file.tsx, 16, 58), Decl(file.tsx, 17, 58))
+>obj2 : Symbol(obj2, Decl(file.tsx, 7, 3))
+>y2 : Symbol(y2, Decl(file.tsx, 23, 36))
+
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload3.types b/tests/baselines/reference/tsxStatelessFunctionComponentOverload3.types
new file mode 100644
index 0000000000000..ce3e5e7abb6b2
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload3.types
@@ -0,0 +1,111 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+interface Context {
+>Context : Context
+
+    color: any;
+>color : any
+}
+declare function ZeroThingOrTwoThing(): JSX.Element;
+>ZeroThingOrTwoThing : { (): JSX.Element; (l: { yy: number; yy1: string; }, context: Context): JSX.Element; }
+>JSX : any
+>Element : JSX.Element
+
+declare function ZeroThingOrTwoThing(l: {yy: number, yy1: string}, context: Context): JSX.Element;
+>ZeroThingOrTwoThing : { (): JSX.Element; (l: { yy: number; yy1: string; }, context: Context): JSX.Element; }
+>l : { yy: number; yy1: string; }
+>yy : number
+>yy1 : string
+>context : Context
+>Context : Context
+>JSX : any
+>Element : JSX.Element
+
+let obj2 = undefined;
+>obj2 : any
+>undefined : undefined
+
+// OK
+const two1 = <ZeroThingOrTwoThing />;
+>two1 : JSX.Element
+><ZeroThingOrTwoThing /> : JSX.Element
+>ZeroThingOrTwoThing : { (): JSX.Element; (l: { yy: number; yy1: string; }, context: Context): JSX.Element; }
+
+const two2 = <ZeroThingOrTwoThing yy={100}  yy1="hello"/>;
+>two2 : JSX.Element
+><ZeroThingOrTwoThing yy={100}  yy1="hello"/> : JSX.Element
+>ZeroThingOrTwoThing : { (): JSX.Element; (l: { yy: number; yy1: string; }, context: Context): JSX.Element; }
+>yy : number
+>100 : 100
+>yy1 : string
+
+const two3 = <ZeroThingOrTwoThing {...obj2} />;  // it is just any so we allow it to pass through
+>two3 : JSX.Element
+><ZeroThingOrTwoThing {...obj2} /> : JSX.Element
+>ZeroThingOrTwoThing : { (): JSX.Element; (l: { yy: number; yy1: string; }, context: Context): JSX.Element; }
+>obj2 : undefined
+
+const two4 = <ZeroThingOrTwoThing  yy={1000} {...obj2} />;  // it is just any so we allow it to pass through
+>two4 : JSX.Element
+><ZeroThingOrTwoThing  yy={1000} {...obj2} /> : JSX.Element
+>ZeroThingOrTwoThing : { (): JSX.Element; (l: { yy: number; yy1: string; }, context: Context): JSX.Element; }
+>yy : number
+>1000 : 1000
+>obj2 : undefined
+
+const two5 = <ZeroThingOrTwoThing  {...obj2} yy={1000} />;  // it is just any so we allow it to pass through
+>two5 : JSX.Element
+><ZeroThingOrTwoThing  {...obj2} yy={1000} /> : JSX.Element
+>ZeroThingOrTwoThing : { (): JSX.Element; (l: { yy: number; yy1: string; }, context: Context): JSX.Element; }
+>obj2 : undefined
+>yy : number
+>1000 : 1000
+
+declare function ThreeThing(l: {y1: string}): JSX.Element;
+>ThreeThing : { (l: { y1: string; }): JSX.Element; (l: { y2: string; }): JSX.Element; (l: { yy: number; yy1: string; }, context: Context, updater: any): JSX.Element; }
+>l : { y1: string; }
+>y1 : string
+>JSX : any
+>Element : JSX.Element
+
+declare function ThreeThing(l: {y2: string}): JSX.Element;
+>ThreeThing : { (l: { y1: string; }): JSX.Element; (l: { y2: string; }): JSX.Element; (l: { yy: number; yy1: string; }, context: Context, updater: any): JSX.Element; }
+>l : { y2: string; }
+>y2 : string
+>JSX : any
+>Element : JSX.Element
+
+declare function ThreeThing(l: {yy: number, yy1: string}, context: Context, updater: any): JSX.Element;
+>ThreeThing : { (l: { y1: string; }): JSX.Element; (l: { y2: string; }): JSX.Element; (l: { yy: number; yy1: string; }, context: Context, updater: any): JSX.Element; }
+>l : { yy: number; yy1: string; }
+>yy : number
+>yy1 : string
+>context : Context
+>Context : Context
+>updater : any
+>JSX : any
+>Element : JSX.Element
+
+// OK
+const three1 = <ThreeThing yy={99} yy1="hello world" />;
+>three1 : JSX.Element
+><ThreeThing yy={99} yy1="hello world" /> : JSX.Element
+>ThreeThing : { (l: { y1: string; }): JSX.Element; (l: { y2: string; }): JSX.Element; (l: { yy: number; yy1: string; }, context: Context, updater: any): JSX.Element; }
+>yy : number
+>99 : 99
+>yy1 : string
+
+const three2 = <ThreeThing y2="Bye" />;
+>three2 : JSX.Element
+><ThreeThing y2="Bye" /> : JSX.Element
+>ThreeThing : { (l: { y1: string; }): JSX.Element; (l: { y2: string; }): JSX.Element; (l: { yy: number; yy1: string; }, context: Context, updater: any): JSX.Element; }
+>y2 : string
+
+const three3 = <ThreeThing {...obj2} y2={10} />;  // it is just any so we allow it to pass through
+>three3 : JSX.Element
+><ThreeThing {...obj2} y2={10} /> : JSX.Element
+>ThreeThing : { (l: { y1: string; }): JSX.Element; (l: { y2: string; }): JSX.Element; (l: { yy: number; yy1: string; }, context: Context, updater: any): JSX.Element; }
+>obj2 : undefined
+>y2 : number
+>10 : 10
+
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt
new file mode 100644
index 0000000000000..f43bd414ef8ff
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.errors.txt
@@ -0,0 +1,112 @@
+tests/cases/conformance/jsx/file.tsx(13,22): error TS2322: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+  Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+tests/cases/conformance/jsx/file.tsx(14,22): error TS2322: Type '{ yy: 10; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+  Type '{ yy: 10; }' is not assignable to type '{ yy: number; yy1: string; }'.
+    Property 'yy1' is missing in type '{ yy: 10; }'.
+tests/cases/conformance/jsx/file.tsx(15,22): error TS2322: Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+  Type '{ yy1: true; yy: number; }' is not assignable to type '{ yy: number; yy1: string; }'.
+    Types of property 'yy1' are incompatible.
+      Type 'true' is not assignable to type 'string'.
+tests/cases/conformance/jsx/file.tsx(16,22): error TS2322: Type '{ extra: string; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+  Property 'extra' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+tests/cases/conformance/jsx/file.tsx(17,22): error TS2322: Type '{ y1: 10000; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+  Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+tests/cases/conformance/jsx/file.tsx(18,22): error TS2322: Type '{ yy: boolean; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+  Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'.
+    Types of property 'yy' are incompatible.
+      Type 'boolean' is not assignable to type 'number'.
+tests/cases/conformance/jsx/file.tsx(26,29): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { yy: string; direction?: number; }'.
+  Type '{}' is not assignable to type '{ yy: string; direction?: number; }'.
+    Property 'yy' is missing in type '{}'.
+tests/cases/conformance/jsx/file.tsx(27,29): error TS2322: Type '{ yy: "hello"; direction: "left"; }' is not assignable to type 'IntrinsicAttributes & { yy: string; direction?: number; }'.
+  Type '{ yy: "hello"; direction: "left"; }' is not assignable to type '{ yy: string; direction?: number; }'.
+    Types of property 'direction' are incompatible.
+      Type '"left"' is not assignable to type 'number'.
+tests/cases/conformance/jsx/file.tsx(33,29): error TS2322: Type '{ y1: true; y3: "hello"; }' is not assignable to type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }'.
+  Type '{ y1: true; y3: "hello"; }' is not assignable to type '{ y1: boolean; y2?: number; y3: boolean; }'.
+    Types of property 'y3' are incompatible.
+      Type '"hello"' is not assignable to type 'boolean'.
+tests/cases/conformance/jsx/file.tsx(34,29): error TS2322: Type '{ y1: "hello"; y2: 1000; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }'.
+  Type '{ y1: "hello"; y2: 1000; y3: true; }' is not assignable to type '{ y1: boolean; y2?: number; y3: boolean; }'.
+    Types of property 'y1' are incompatible.
+      Type '"hello"' is not assignable to type 'boolean'.
+
+
+==== tests/cases/conformance/jsx/file.tsx (10 errors) ====
+    
+    import React = require('react')
+    declare function OneThing(): JSX.Element;
+    declare function OneThing(l: {yy: number, yy1: string}): JSX.Element;
+    
+    let obj = {
+        yy: 10,
+        yy1: "hello"
+    }
+    let obj2 = undefined;
+    
+    // Error
+    const c0 = <OneThing extraProp />;  // extra property;
+                         ~~~~~~~~~
+!!! error TS2322: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+!!! error TS2322:   Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+    const c1 = <OneThing yy={10}/>;  // missing property;
+                         ~~~~~~~
+!!! error TS2322: Type '{ yy: 10; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+!!! error TS2322:   Type '{ yy: 10; }' is not assignable to type '{ yy: number; yy1: string; }'.
+!!! error TS2322:     Property 'yy1' is missing in type '{ yy: 10; }'.
+    const c2 = <OneThing {...obj} yy1 />; // type incompatible;
+                         ~~~~~~~~~~~~
+!!! error TS2322: Type '{ yy1: true; yy: number; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+!!! error TS2322:   Type '{ yy1: true; yy: number; }' is not assignable to type '{ yy: number; yy1: string; }'.
+!!! error TS2322:     Types of property 'yy1' are incompatible.
+!!! error TS2322:       Type 'true' is not assignable to type 'string'.
+    const c3 = <OneThing {...obj} {...{extra: "extra attr"}} />;  // Extra attribute;
+                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ extra: string; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+!!! error TS2322:   Property 'extra' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+    const c4 = <OneThing {...obj} y1={10000} />;  // extra property;
+                         ~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ y1: 10000; yy: number; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+!!! error TS2322:   Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+    const c5 = <OneThing {...obj} {...{yy: true}} />;  // type incompatible;
+                         ~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ yy: boolean; yy1: string; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'.
+!!! error TS2322:   Type '{ yy: boolean; yy1: string; }' is not assignable to type '{ yy: number; yy1: string; }'.
+!!! error TS2322:     Types of property 'yy' are incompatible.
+!!! error TS2322:       Type 'boolean' is not assignable to type 'number'.
+    const c6 = <OneThing {...obj2} {...{extra: "extra attr"}} />;  // Should error as there is extra attribute that doesn't match any. Current it is not
+    const c7 = <OneThing {...obj2} yy />;  // Should error as there is extra attribute that doesn't match any. Current it is not
+    
+    declare function TestingOneThing(j: {"extra-data": string}): JSX.Element;
+    declare function TestingOneThing(n: {yy: string, direction?: number}): JSX.Element;
+    
+    // Error
+    const d1 = <TestingOneThing extra-data />
+                                ~~~~~~~~~~
+!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { yy: string; direction?: number; }'.
+!!! error TS2322:   Type '{}' is not assignable to type '{ yy: string; direction?: number; }'.
+!!! error TS2322:     Property 'yy' is missing in type '{}'.
+    const d2 = <TestingOneThing yy="hello" direction="left" />
+                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ yy: "hello"; direction: "left"; }' is not assignable to type 'IntrinsicAttributes & { yy: string; direction?: number; }'.
+!!! error TS2322:   Type '{ yy: "hello"; direction: "left"; }' is not assignable to type '{ yy: string; direction?: number; }'.
+!!! error TS2322:     Types of property 'direction' are incompatible.
+!!! error TS2322:       Type '"left"' is not assignable to type 'number'.
+    
+    declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element;
+    declare function TestingOptional(a: {y1: boolean, y2?: number, y3: boolean}): JSX.Element;
+    
+    // Error
+    const e1 = <TestingOptional y1 y3="hello"/>
+                                ~~~~~~~~~~~~~
+!!! error TS2322: Type '{ y1: true; y3: "hello"; }' is not assignable to type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }'.
+!!! error TS2322:   Type '{ y1: true; y3: "hello"; }' is not assignable to type '{ y1: boolean; y2?: number; y3: boolean; }'.
+!!! error TS2322:     Types of property 'y3' are incompatible.
+!!! error TS2322:       Type '"hello"' is not assignable to type 'boolean'.
+    const e2 = <TestingOptional y1="hello" y2={1000} y3 />
+                                ~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ y1: "hello"; y2: 1000; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }'.
+!!! error TS2322:   Type '{ y1: "hello"; y2: 1000; y3: true; }' is not assignable to type '{ y1: boolean; y2?: number; y3: boolean; }'.
+!!! error TS2322:     Types of property 'y1' are incompatible.
+!!! error TS2322:       Type '"hello"' is not assignable to type 'boolean'.
+    
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.js b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.js
new file mode 100644
index 0000000000000..f43b4a845d01e
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload4.js
@@ -0,0 +1,61 @@
+//// [file.tsx]
+
+import React = require('react')
+declare function OneThing(): JSX.Element;
+declare function OneThing(l: {yy: number, yy1: string}): JSX.Element;
+
+let obj = {
+    yy: 10,
+    yy1: "hello"
+}
+let obj2 = undefined;
+
+// Error
+const c0 = <OneThing extraProp />;  // extra property;
+const c1 = <OneThing yy={10}/>;  // missing property;
+const c2 = <OneThing {...obj} yy1 />; // type incompatible;
+const c3 = <OneThing {...obj} {...{extra: "extra attr"}} />;  // Extra attribute;
+const c4 = <OneThing {...obj} y1={10000} />;  // extra property;
+const c5 = <OneThing {...obj} {...{yy: true}} />;  // type incompatible;
+const c6 = <OneThing {...obj2} {...{extra: "extra attr"}} />;  // Should error as there is extra attribute that doesn't match any. Current it is not
+const c7 = <OneThing {...obj2} yy />;  // Should error as there is extra attribute that doesn't match any. Current it is not
+
+declare function TestingOneThing(j: {"extra-data": string}): JSX.Element;
+declare function TestingOneThing(n: {yy: string, direction?: number}): JSX.Element;
+
+// Error
+const d1 = <TestingOneThing extra-data />
+const d2 = <TestingOneThing yy="hello" direction="left" />
+
+declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element;
+declare function TestingOptional(a: {y1: boolean, y2?: number, y3: boolean}): JSX.Element;
+
+// Error
+const e1 = <TestingOptional y1 y3="hello"/>
+const e2 = <TestingOptional y1="hello" y2={1000} y3 />
+
+
+//// [file.jsx]
+define(["require", "exports", "react"], function (require, exports, React) {
+    "use strict";
+    var obj = {
+        yy: 10,
+        yy1: "hello"
+    };
+    var obj2 = undefined;
+    // Error
+    var c0 = <OneThing extraProp/>; // extra property;
+    var c1 = <OneThing yy={10}/>; // missing property;
+    var c2 = <OneThing {...obj} yy1/>; // type incompatible;
+    var c3 = <OneThing {...obj} {...{ extra: "extra attr" }}/>; // Extra attribute;
+    var c4 = <OneThing {...obj} y1={10000}/>; // extra property;
+    var c5 = <OneThing {...obj} {...{ yy: true }}/>; // type incompatible;
+    var c6 = <OneThing {...obj2} {...{ extra: "extra attr" }}/>; // Should error as there is extra attribute that doesn't match any. Current it is not
+    var c7 = <OneThing {...obj2} yy/>; // Should error as there is extra attribute that doesn't match any. Current it is not
+    // Error
+    var d1 = <TestingOneThing extra-data/>;
+    var d2 = <TestingOneThing yy="hello" direction="left"/>;
+    // Error
+    var e1 = <TestingOptional y1 y3="hello"/>;
+    var e2 = <TestingOptional y1="hello" y2={1000} y3/>;
+});
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt
new file mode 100644
index 0000000000000..b3d954baa841a
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.errors.txt
@@ -0,0 +1,110 @@
+tests/cases/conformance/jsx/file.tsx(49,24): error TS2322: Type '{ to: "/some/path"; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
+  Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'.
+tests/cases/conformance/jsx/file.tsx(50,24): error TS2322: Type '{ to: string; onClick: (e: any) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
+  Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'.
+tests/cases/conformance/jsx/file.tsx(51,24): error TS2322: Type '{ onClick: () => void; to: string; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
+  Property 'onClick' does not exist on type 'IntrinsicAttributes & HyphenProps'.
+tests/cases/conformance/jsx/file.tsx(52,24): error TS2322: Type '{ onClick: (k: any) => void; to: string; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
+  Property 'onClick' does not exist on type 'IntrinsicAttributes & HyphenProps'.
+tests/cases/conformance/jsx/file.tsx(54,24): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
+  Type '{}' is not assignable to type 'HyphenProps'.
+    Property '"data-format"' is missing in type '{}'.
+tests/cases/conformance/jsx/file.tsx(55,24): error TS2322: Type '{ children: 10; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
+  Type '{ children: 10; }' is not assignable to type 'HyphenProps'.
+    Property '"data-format"' is missing in type '{ children: 10; }'.
+tests/cases/conformance/jsx/file.tsx(56,24): error TS2322: Type '{ children: "hello"; className: true; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
+  Type '{ children: "hello"; className: true; }' is not assignable to type 'HyphenProps'.
+    Property '"data-format"' is missing in type '{ children: "hello"; className: true; }'.
+tests/cases/conformance/jsx/file.tsx(57,24): error TS2322: Type '{ data-format: true; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
+  Type '{ data-format: true; }' is not assignable to type 'HyphenProps'.
+    Types of property '"data-format"' are incompatible.
+      Type 'true' is not assignable to type 'string'.
+
+
+==== tests/cases/conformance/jsx/file.tsx (8 errors) ====
+    
+    import React = require('react')
+    
+    export interface ClickableProps {
+        children?: string;
+        className?: string;
+    }
+    
+    export interface ButtonProps extends ClickableProps {
+        onClick: React.MouseEventHandler<any>;
+    }
+    
+    export interface LinkProps extends ClickableProps {
+        to: string;
+    }
+    
+    export interface HyphenProps extends ClickableProps {
+        "data-format": string;
+    }
+    
+    let obj0 = {
+        to: "world"
+    };
+    
+    let obj1 = {
+        children: "hi",
+        to: "boo"
+    }
+    
+    let obj2 = {
+        onClick: ()=>{}
+    }
+    
+    let obj3 = undefined;
+    
+    export function MainButton(buttonProps: ButtonProps): JSX.Element;
+    export function MainButton(linkProps: LinkProps): JSX.Element;
+    export function MainButton(hyphenProps: HyphenProps): JSX.Element;
+    export function MainButton(props: ButtonProps | LinkProps | HyphenProps): JSX.Element {
+        const linkProps = props as LinkProps;
+        if(linkProps.to) {
+            return this._buildMainLink(props);
+        }
+    
+        return this._buildMainButton(props);
+    }
+    
+    // Error
+    const b0 = <MainButton to='/some/path' onClick={(e)=>{}}>GO</MainButton>;  // extra property;
+                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ to: "/some/path"; onClick: (e: MouseEvent<any>) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
+!!! error TS2322:   Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'.
+    const b1 = <MainButton onClick={(e: any)=> {}} {...obj0}>Hello world</MainButton>;  // extra property;
+                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ to: string; onClick: (e: any) => void; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
+!!! error TS2322:   Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'.
+    const b2 = <MainButton {...{to: "10000"}} {...obj2} />;  // extra property
+                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ onClick: () => void; to: string; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
+!!! error TS2322:   Property 'onClick' does not exist on type 'IntrinsicAttributes & HyphenProps'.
+    const b3 = <MainButton {...{to: "10000"}} {...{onClick: (k) => {}}} />;  // extra property
+                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ onClick: (k: any) => void; to: string; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
+!!! error TS2322:   Property 'onClick' does not exist on type 'IntrinsicAttributes & HyphenProps'.
+    const b4 = <MainButton {...obj3} to />;  // Shoudld erro because Incorrect type; but attributes are any so everything is allowed
+    const b5 = <MainButton {...{ onclick(){} }} />;  // Spread doesn't retain method declaration
+                           ~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
+!!! error TS2322:   Type '{}' is not assignable to type 'HyphenProps'.
+!!! error TS2322:     Property '"data-format"' is missing in type '{}'.
+    const b6 = <MainButton {...{ onclick(){} }} children={10} />;  // incorrect type for optional attribute
+                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ children: 10; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
+!!! error TS2322:   Type '{ children: 10; }' is not assignable to type 'HyphenProps'.
+!!! error TS2322:     Property '"data-format"' is missing in type '{ children: 10; }'.
+    const b7 = <MainButton {...{ onclick(){} }} children="hello" className />;  // incorrect type for optional attribute
+                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ children: "hello"; className: true; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
+!!! error TS2322:   Type '{ children: "hello"; className: true; }' is not assignable to type 'HyphenProps'.
+!!! error TS2322:     Property '"data-format"' is missing in type '{ children: "hello"; className: true; }'.
+    const b8 = <MainButton data-format />;  // incorrect type for specified hyphanted name
+                           ~~~~~~~~~~~
+!!! error TS2322: Type '{ data-format: true; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'.
+!!! error TS2322:   Type '{ data-format: true; }' is not assignable to type 'HyphenProps'.
+!!! error TS2322:     Types of property '"data-format"' are incompatible.
+!!! error TS2322:       Type 'true' is not assignable to type 'string'.
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.js b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.js
new file mode 100644
index 0000000000000..21cae8eb39541
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload5.js
@@ -0,0 +1,92 @@
+//// [file.tsx]
+
+import React = require('react')
+
+export interface ClickableProps {
+    children?: string;
+    className?: string;
+}
+
+export interface ButtonProps extends ClickableProps {
+    onClick: React.MouseEventHandler<any>;
+}
+
+export interface LinkProps extends ClickableProps {
+    to: string;
+}
+
+export interface HyphenProps extends ClickableProps {
+    "data-format": string;
+}
+
+let obj0 = {
+    to: "world"
+};
+
+let obj1 = {
+    children: "hi",
+    to: "boo"
+}
+
+let obj2 = {
+    onClick: ()=>{}
+}
+
+let obj3 = undefined;
+
+export function MainButton(buttonProps: ButtonProps): JSX.Element;
+export function MainButton(linkProps: LinkProps): JSX.Element;
+export function MainButton(hyphenProps: HyphenProps): JSX.Element;
+export function MainButton(props: ButtonProps | LinkProps | HyphenProps): JSX.Element {
+    const linkProps = props as LinkProps;
+    if(linkProps.to) {
+        return this._buildMainLink(props);
+    }
+
+    return this._buildMainButton(props);
+}
+
+// Error
+const b0 = <MainButton to='/some/path' onClick={(e)=>{}}>GO</MainButton>;  // extra property;
+const b1 = <MainButton onClick={(e: any)=> {}} {...obj0}>Hello world</MainButton>;  // extra property;
+const b2 = <MainButton {...{to: "10000"}} {...obj2} />;  // extra property
+const b3 = <MainButton {...{to: "10000"}} {...{onClick: (k) => {}}} />;  // extra property
+const b4 = <MainButton {...obj3} to />;  // Shoudld erro because Incorrect type; but attributes are any so everything is allowed
+const b5 = <MainButton {...{ onclick(){} }} />;  // Spread doesn't retain method declaration
+const b6 = <MainButton {...{ onclick(){} }} children={10} />;  // incorrect type for optional attribute
+const b7 = <MainButton {...{ onclick(){} }} children="hello" className />;  // incorrect type for optional attribute
+const b8 = <MainButton data-format />;  // incorrect type for specified hyphanted name
+
+//// [file.jsx]
+define(["require", "exports", "react"], function (require, exports, React) {
+    "use strict";
+    var obj0 = {
+        to: "world"
+    };
+    var obj1 = {
+        children: "hi",
+        to: "boo"
+    };
+    var obj2 = {
+        onClick: function () { }
+    };
+    var obj3 = undefined;
+    function MainButton(props) {
+        var linkProps = props;
+        if (linkProps.to) {
+            return this._buildMainLink(props);
+        }
+        return this._buildMainButton(props);
+    }
+    exports.MainButton = MainButton;
+    // Error
+    var b0 = <MainButton to='/some/path' onClick={function (e) { }}>GO</MainButton>; // extra property;
+    var b1 = <MainButton onClick={function (e) { }} {...obj0}>Hello world</MainButton>; // extra property;
+    var b2 = <MainButton {...{ to: "10000" }} {...obj2}/>; // extra property
+    var b3 = <MainButton {...{ to: "10000" }} {...{ onClick: function (k) { } }}/>; // extra property
+    var b4 = <MainButton {...obj3} to/>; // Shoudld erro because Incorrect type; but attributes are any so everything is allowed
+    var b5 = <MainButton {...{ onclick: function () { } }}/>; // Spread doesn't retain method declaration
+    var b6 = <MainButton {...{ onclick: function () { } }} children={10}/>; // incorrect type for optional attribute
+    var b7 = <MainButton {...{ onclick: function () { } }} children="hello" className/>; // incorrect type for optional attribute
+    var b8 = <MainButton data-format/>; // incorrect type for specified hyphanted name
+});
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload6.js b/tests/baselines/reference/tsxStatelessFunctionComponentOverload6.js
new file mode 100644
index 0000000000000..071a7d0534788
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload6.js
@@ -0,0 +1,94 @@
+//// [file.tsx]
+
+import React = require('react')
+
+export interface ClickableProps {
+    children?: string;
+    className?: string;
+}
+
+export interface ButtonProps extends ClickableProps {
+    onClick: React.MouseEventHandler<any>;
+}
+
+export interface LinkProps extends ClickableProps {
+    to: string;
+}
+
+export interface HyphenProps extends ClickableProps {
+    "data-format": string;
+}
+
+let obj = {
+    children: "hi",
+    to: "boo"
+}
+let obj1 = undefined;
+let obj2 = {
+    onClick: () => {}
+}
+
+export function MainButton(buttonProps: ButtonProps): JSX.Element;
+export function MainButton(linkProps: LinkProps): JSX.Element;
+export function MainButton(hyphenProps: HyphenProps): JSX.Element;
+export function MainButton(props: ButtonProps | LinkProps | HyphenProps): JSX.Element {
+    const linkProps = props as LinkProps;
+    if(linkProps.to) {
+        return this._buildMainLink(props);
+    }
+
+    return this._buildMainButton(props);
+}
+
+// OK
+const b0 = <MainButton to='/some/path'>GO</MainButton>;
+const b1 = <MainButton onClick={(e) => {}}>Hello world</MainButton>;
+const b2 = <MainButton {...obj} />;
+const b3 = <MainButton {...{to: 10000}} {...obj} />;
+const b4 = <MainButton {...obj1} />;  // any; just pick the first overload
+const b5 = <MainButton {...obj1} to="/to/somewhere" />;  // should pick the second overload
+const b6 = <MainButton {...obj2} />;
+const b7 = <MainButton {...{onClick: () => { console.log("hi") }}} />;
+const b8 = <MainButton {...obj} {...{onClick() {}}} />;  // OK; method declaration get discarded
+const b9 = <MainButton to='/some/path' extra-prop>GO</MainButton>;
+const b10 = <MainButton to='/some/path' children="hi" >GO</MainButton>;
+const b11 = <MainButton onClick={(e) => {}} className="hello" data-format>Hello world</MainButton>;
+const b12 = <MainButton data-format="Hello world" />
+
+
+
+
+//// [file.jsx]
+define(["require", "exports", "react"], function (require, exports, React) {
+    "use strict";
+    var obj = {
+        children: "hi",
+        to: "boo"
+    };
+    var obj1 = undefined;
+    var obj2 = {
+        onClick: function () { }
+    };
+    function MainButton(props) {
+        var linkProps = props;
+        if (linkProps.to) {
+            return this._buildMainLink(props);
+        }
+        return this._buildMainButton(props);
+    }
+    exports.MainButton = MainButton;
+    // OK
+    var b0 = <MainButton to='/some/path'>GO</MainButton>;
+    var b1 = <MainButton onClick={function (e) { }}>Hello world</MainButton>;
+    var b2 = <MainButton {...obj}/>;
+    var b3 = <MainButton {...{ to: 10000 }} {...obj}/>;
+    var b4 = <MainButton {...obj1}/>; // any; just pick the first overload
+    var b5 = <MainButton {...obj1} to="/to/somewhere"/>; // should pick the second overload
+    var b6 = <MainButton {...obj2}/>;
+    var b7 = <MainButton {...{ onClick: function () { console.log("hi"); } }}/>;
+    var b8 = <MainButton {...obj} {...{ onClick: function () { } }}/>; // OK; method declaration get discarded
+    var b9 = <MainButton to='/some/path' extra-prop>GO</MainButton>;
+    var b10 = <MainButton to='/some/path' children="hi">GO</MainButton>;
+    var b11 = <MainButton onClick={function (e) { }} className="hello" data-format>Hello world</MainButton>;
+    var b12 = <MainButton data-format="Hello world"/>;
+});
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload6.symbols b/tests/baselines/reference/tsxStatelessFunctionComponentOverload6.symbols
new file mode 100644
index 0000000000000..308752e1c217a
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload6.symbols
@@ -0,0 +1,193 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react')
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+
+export interface ClickableProps {
+>ClickableProps : Symbol(ClickableProps, Decl(file.tsx, 1, 31))
+
+    children?: string;
+>children : Symbol(ClickableProps.children, Decl(file.tsx, 3, 33))
+
+    className?: string;
+>className : Symbol(ClickableProps.className, Decl(file.tsx, 4, 22))
+}
+
+export interface ButtonProps extends ClickableProps {
+>ButtonProps : Symbol(ButtonProps, Decl(file.tsx, 6, 1))
+>ClickableProps : Symbol(ClickableProps, Decl(file.tsx, 1, 31))
+
+    onClick: React.MouseEventHandler<any>;
+>onClick : Symbol(ButtonProps.onClick, Decl(file.tsx, 8, 53))
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+>MouseEventHandler : Symbol(React.MouseEventHandler, Decl(react.d.ts, 388, 66))
+}
+
+export interface LinkProps extends ClickableProps {
+>LinkProps : Symbol(LinkProps, Decl(file.tsx, 10, 1))
+>ClickableProps : Symbol(ClickableProps, Decl(file.tsx, 1, 31))
+
+    to: string;
+>to : Symbol(LinkProps.to, Decl(file.tsx, 12, 51))
+}
+
+export interface HyphenProps extends ClickableProps {
+>HyphenProps : Symbol(HyphenProps, Decl(file.tsx, 14, 1))
+>ClickableProps : Symbol(ClickableProps, Decl(file.tsx, 1, 31))
+
+    "data-format": string;
+}
+
+let obj = {
+>obj : Symbol(obj, Decl(file.tsx, 20, 3))
+
+    children: "hi",
+>children : Symbol(children, Decl(file.tsx, 20, 11))
+
+    to: "boo"
+>to : Symbol(to, Decl(file.tsx, 21, 19))
+}
+let obj1 = undefined;
+>obj1 : Symbol(obj1, Decl(file.tsx, 24, 3))
+>undefined : Symbol(undefined)
+
+let obj2 = {
+>obj2 : Symbol(obj2, Decl(file.tsx, 25, 3))
+
+    onClick: () => {}
+>onClick : Symbol(onClick, Decl(file.tsx, 25, 12))
+}
+
+export function MainButton(buttonProps: ButtonProps): JSX.Element;
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>buttonProps : Symbol(buttonProps, Decl(file.tsx, 29, 27))
+>ButtonProps : Symbol(ButtonProps, Decl(file.tsx, 6, 1))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+export function MainButton(linkProps: LinkProps): JSX.Element;
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>linkProps : Symbol(linkProps, Decl(file.tsx, 30, 27))
+>LinkProps : Symbol(LinkProps, Decl(file.tsx, 10, 1))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+export function MainButton(hyphenProps: HyphenProps): JSX.Element;
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>hyphenProps : Symbol(hyphenProps, Decl(file.tsx, 31, 27))
+>HyphenProps : Symbol(HyphenProps, Decl(file.tsx, 14, 1))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+export function MainButton(props: ButtonProps | LinkProps | HyphenProps): JSX.Element {
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>props : Symbol(props, Decl(file.tsx, 32, 27))
+>ButtonProps : Symbol(ButtonProps, Decl(file.tsx, 6, 1))
+>LinkProps : Symbol(LinkProps, Decl(file.tsx, 10, 1))
+>HyphenProps : Symbol(HyphenProps, Decl(file.tsx, 14, 1))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+    const linkProps = props as LinkProps;
+>linkProps : Symbol(linkProps, Decl(file.tsx, 33, 9))
+>props : Symbol(props, Decl(file.tsx, 32, 27))
+>LinkProps : Symbol(LinkProps, Decl(file.tsx, 10, 1))
+
+    if(linkProps.to) {
+>linkProps.to : Symbol(LinkProps.to, Decl(file.tsx, 12, 51))
+>linkProps : Symbol(linkProps, Decl(file.tsx, 33, 9))
+>to : Symbol(LinkProps.to, Decl(file.tsx, 12, 51))
+
+        return this._buildMainLink(props);
+>props : Symbol(props, Decl(file.tsx, 32, 27))
+    }
+
+    return this._buildMainButton(props);
+>props : Symbol(props, Decl(file.tsx, 32, 27))
+}
+
+// OK
+const b0 = <MainButton to='/some/path'>GO</MainButton>;
+>b0 : Symbol(b0, Decl(file.tsx, 42, 5))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>to : Symbol(to, Decl(file.tsx, 42, 22))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+
+const b1 = <MainButton onClick={(e) => {}}>Hello world</MainButton>;
+>b1 : Symbol(b1, Decl(file.tsx, 43, 5))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>onClick : Symbol(onClick, Decl(file.tsx, 43, 22))
+>e : Symbol(e, Decl(file.tsx, 43, 33))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+
+const b2 = <MainButton {...obj} />;
+>b2 : Symbol(b2, Decl(file.tsx, 44, 5))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>obj : Symbol(obj, Decl(file.tsx, 20, 3))
+
+const b3 = <MainButton {...{to: 10000}} {...obj} />;
+>b3 : Symbol(b3, Decl(file.tsx, 45, 5))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>to : Symbol(to, Decl(file.tsx, 45, 28))
+>obj : Symbol(obj, Decl(file.tsx, 20, 3))
+
+const b4 = <MainButton {...obj1} />;  // any; just pick the first overload
+>b4 : Symbol(b4, Decl(file.tsx, 46, 5))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>obj1 : Symbol(obj1, Decl(file.tsx, 24, 3))
+
+const b5 = <MainButton {...obj1} to="/to/somewhere" />;  // should pick the second overload
+>b5 : Symbol(b5, Decl(file.tsx, 47, 5))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>obj1 : Symbol(obj1, Decl(file.tsx, 24, 3))
+>to : Symbol(to, Decl(file.tsx, 47, 32))
+
+const b6 = <MainButton {...obj2} />;
+>b6 : Symbol(b6, Decl(file.tsx, 48, 5))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>obj2 : Symbol(obj2, Decl(file.tsx, 25, 3))
+
+const b7 = <MainButton {...{onClick: () => { console.log("hi") }}} />;
+>b7 : Symbol(b7, Decl(file.tsx, 49, 5))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>onClick : Symbol(onClick, Decl(file.tsx, 49, 28))
+>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --))
+>console : Symbol(console, Decl(lib.d.ts, --, --))
+>log : Symbol(Console.log, Decl(lib.d.ts, --, --))
+
+const b8 = <MainButton {...obj} {...{onClick() {}}} />;  // OK; method declaration get discarded
+>b8 : Symbol(b8, Decl(file.tsx, 50, 5))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>obj : Symbol(obj, Decl(file.tsx, 20, 3))
+>onClick : Symbol(onClick, Decl(file.tsx, 50, 37))
+
+const b9 = <MainButton to='/some/path' extra-prop>GO</MainButton>;
+>b9 : Symbol(b9, Decl(file.tsx, 51, 5))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>to : Symbol(to, Decl(file.tsx, 51, 22))
+>extra-prop : Symbol(extra-prop, Decl(file.tsx, 51, 38))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+
+const b10 = <MainButton to='/some/path' children="hi" >GO</MainButton>;
+>b10 : Symbol(b10, Decl(file.tsx, 52, 5))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>to : Symbol(to, Decl(file.tsx, 52, 23))
+>children : Symbol(children, Decl(file.tsx, 52, 39))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+
+const b11 = <MainButton onClick={(e) => {}} className="hello" data-format>Hello world</MainButton>;
+>b11 : Symbol(b11, Decl(file.tsx, 53, 5))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>onClick : Symbol(onClick, Decl(file.tsx, 53, 23))
+>e : Symbol(e, Decl(file.tsx, 53, 34))
+>className : Symbol(className, Decl(file.tsx, 53, 43))
+>data-format : Symbol(data-format, Decl(file.tsx, 53, 61))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+
+const b12 = <MainButton data-format="Hello world" />
+>b12 : Symbol(b12, Decl(file.tsx, 54, 5))
+>MainButton : Symbol(MainButton, Decl(file.tsx, 27, 1), Decl(file.tsx, 29, 66), Decl(file.tsx, 30, 62), Decl(file.tsx, 31, 66))
+>data-format : Symbol(data-format, Decl(file.tsx, 54, 23))
+
+
+
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload6.types b/tests/baselines/reference/tsxStatelessFunctionComponentOverload6.types
new file mode 100644
index 0000000000000..296619e2051b6
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload6.types
@@ -0,0 +1,229 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react')
+>React : typeof React
+
+export interface ClickableProps {
+>ClickableProps : ClickableProps
+
+    children?: string;
+>children : string
+
+    className?: string;
+>className : string
+}
+
+export interface ButtonProps extends ClickableProps {
+>ButtonProps : ButtonProps
+>ClickableProps : ClickableProps
+
+    onClick: React.MouseEventHandler<any>;
+>onClick : React.EventHandler<React.MouseEvent<any>>
+>React : any
+>MouseEventHandler : React.EventHandler<React.MouseEvent<T>>
+}
+
+export interface LinkProps extends ClickableProps {
+>LinkProps : LinkProps
+>ClickableProps : ClickableProps
+
+    to: string;
+>to : string
+}
+
+export interface HyphenProps extends ClickableProps {
+>HyphenProps : HyphenProps
+>ClickableProps : ClickableProps
+
+    "data-format": string;
+}
+
+let obj = {
+>obj : { children: string; to: string; }
+>{    children: "hi",    to: "boo"} : { children: string; to: string; }
+
+    children: "hi",
+>children : string
+>"hi" : "hi"
+
+    to: "boo"
+>to : string
+>"boo" : "boo"
+}
+let obj1 = undefined;
+>obj1 : any
+>undefined : undefined
+
+let obj2 = {
+>obj2 : { onClick: () => void; }
+>{    onClick: () => {}} : { onClick: () => void; }
+
+    onClick: () => {}
+>onClick : () => void
+>() => {} : () => void
+}
+
+export function MainButton(buttonProps: ButtonProps): JSX.Element;
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>buttonProps : ButtonProps
+>ButtonProps : ButtonProps
+>JSX : any
+>Element : JSX.Element
+
+export function MainButton(linkProps: LinkProps): JSX.Element;
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>linkProps : LinkProps
+>LinkProps : LinkProps
+>JSX : any
+>Element : JSX.Element
+
+export function MainButton(hyphenProps: HyphenProps): JSX.Element;
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>hyphenProps : HyphenProps
+>HyphenProps : HyphenProps
+>JSX : any
+>Element : JSX.Element
+
+export function MainButton(props: ButtonProps | LinkProps | HyphenProps): JSX.Element {
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>props : ButtonProps | LinkProps | HyphenProps
+>ButtonProps : ButtonProps
+>LinkProps : LinkProps
+>HyphenProps : HyphenProps
+>JSX : any
+>Element : JSX.Element
+
+    const linkProps = props as LinkProps;
+>linkProps : LinkProps
+>props as LinkProps : LinkProps
+>props : ButtonProps | LinkProps | HyphenProps
+>LinkProps : LinkProps
+
+    if(linkProps.to) {
+>linkProps.to : string
+>linkProps : LinkProps
+>to : string
+
+        return this._buildMainLink(props);
+>this._buildMainLink(props) : any
+>this._buildMainLink : any
+>this : any
+>_buildMainLink : any
+>props : ButtonProps | LinkProps | HyphenProps
+    }
+
+    return this._buildMainButton(props);
+>this._buildMainButton(props) : any
+>this._buildMainButton : any
+>this : any
+>_buildMainButton : any
+>props : ButtonProps | LinkProps | HyphenProps
+}
+
+// OK
+const b0 = <MainButton to='/some/path'>GO</MainButton>;
+>b0 : JSX.Element
+><MainButton to='/some/path'>GO</MainButton> : JSX.Element
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>to : string
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+
+const b1 = <MainButton onClick={(e) => {}}>Hello world</MainButton>;
+>b1 : JSX.Element
+><MainButton onClick={(e) => {}}>Hello world</MainButton> : JSX.Element
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>onClick : (e: React.MouseEvent<any>) => void
+>(e) => {} : (e: React.MouseEvent<any>) => void
+>e : React.MouseEvent<any>
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+
+const b2 = <MainButton {...obj} />;
+>b2 : JSX.Element
+><MainButton {...obj} /> : JSX.Element
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>obj : { children: string; to: string; }
+
+const b3 = <MainButton {...{to: 10000}} {...obj} />;
+>b3 : JSX.Element
+><MainButton {...{to: 10000}} {...obj} /> : JSX.Element
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>{to: 10000} : { to: number; }
+>to : number
+>10000 : 10000
+>obj : { children: string; to: string; }
+
+const b4 = <MainButton {...obj1} />;  // any; just pick the first overload
+>b4 : JSX.Element
+><MainButton {...obj1} /> : JSX.Element
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>obj1 : undefined
+
+const b5 = <MainButton {...obj1} to="/to/somewhere" />;  // should pick the second overload
+>b5 : JSX.Element
+><MainButton {...obj1} to="/to/somewhere" /> : JSX.Element
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>obj1 : undefined
+>to : string
+
+const b6 = <MainButton {...obj2} />;
+>b6 : JSX.Element
+><MainButton {...obj2} /> : JSX.Element
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>obj2 : { onClick: () => void; }
+
+const b7 = <MainButton {...{onClick: () => { console.log("hi") }}} />;
+>b7 : JSX.Element
+><MainButton {...{onClick: () => { console.log("hi") }}} /> : JSX.Element
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>{onClick: () => { console.log("hi") }} : { onClick: () => void; }
+>onClick : () => void
+>() => { console.log("hi") } : () => void
+>console.log("hi") : void
+>console.log : (message?: any, ...optionalParams: any[]) => void
+>console : Console
+>log : (message?: any, ...optionalParams: any[]) => void
+>"hi" : "hi"
+
+const b8 = <MainButton {...obj} {...{onClick() {}}} />;  // OK; method declaration get discarded
+>b8 : JSX.Element
+><MainButton {...obj} {...{onClick() {}}} /> : JSX.Element
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>obj : { children: string; to: string; }
+>{onClick() {}} : { onClick(): void; }
+>onClick : () => void
+
+const b9 = <MainButton to='/some/path' extra-prop>GO</MainButton>;
+>b9 : JSX.Element
+><MainButton to='/some/path' extra-prop>GO</MainButton> : JSX.Element
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>to : string
+>extra-prop : true
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+
+const b10 = <MainButton to='/some/path' children="hi" >GO</MainButton>;
+>b10 : JSX.Element
+><MainButton to='/some/path' children="hi" >GO</MainButton> : JSX.Element
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>to : string
+>children : string
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+
+const b11 = <MainButton onClick={(e) => {}} className="hello" data-format>Hello world</MainButton>;
+>b11 : JSX.Element
+><MainButton onClick={(e) => {}} className="hello" data-format>Hello world</MainButton> : JSX.Element
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>onClick : (e: React.MouseEvent<any>) => void
+>(e) => {} : (e: React.MouseEvent<any>) => void
+>e : React.MouseEvent<any>
+>className : string
+>data-format : true
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+
+const b12 = <MainButton data-format="Hello world" />
+>b12 : JSX.Element
+><MainButton data-format="Hello world" /> : JSX.Element
+>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; (hyphenProps: HyphenProps): JSX.Element; }
+>data-format : string
+
+
+
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt
index e1f7570d9c0a0..4b95ae8a38fb3 100644
--- a/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt
+++ b/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt
@@ -1,7 +1,14 @@
-tests/cases/conformance/jsx/file.tsx(12,9): error TS2324: Property 'name' is missing in type 'IntrinsicAttributes & { name: string; }'.
-tests/cases/conformance/jsx/file.tsx(12,16): error TS2339: Property 'naaame' does not exist on type 'IntrinsicAttributes & { name: string; }'.
-tests/cases/conformance/jsx/file.tsx(19,15): error TS2322: Type '42' is not assignable to type 'string'.
-tests/cases/conformance/jsx/file.tsx(21,15): error TS2339: Property 'naaaaaaame' does not exist on type 'IntrinsicAttributes & { name?: string; }'.
+tests/cases/conformance/jsx/file.tsx(16,16): error TS2322: Type '{ naaame: "world"; }' is not assignable to type 'IntrinsicAttributes & { name: string; }'.
+  Property 'naaame' does not exist on type 'IntrinsicAttributes & { name: string; }'.
+tests/cases/conformance/jsx/file.tsx(24,15): error TS2322: Type '{ name: 42; }' is not assignable to type 'IntrinsicAttributes & { name?: string; }'.
+  Type '{ name: 42; }' is not assignable to type '{ name?: string; }'.
+    Types of property 'name' are incompatible.
+      Type '42' is not assignable to type 'string'.
+tests/cases/conformance/jsx/file.tsx(26,15): error TS2322: Type '{ naaaaaaame: "no"; }' is not assignable to type 'IntrinsicAttributes & { name?: string; }'.
+  Property 'naaaaaaame' does not exist on type 'IntrinsicAttributes & { name?: string; }'.
+tests/cases/conformance/jsx/file.tsx(31,23): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { "prop-name": string; }'.
+  Type '{}' is not assignable to type '{ "prop-name": string; }'.
+    Property '"prop-name"' is missing in type '{}'.
 
 
 ==== tests/cases/conformance/jsx/file.tsx (4 errors) ====
@@ -12,26 +19,44 @@ tests/cases/conformance/jsx/file.tsx(21,15): error TS2339: Property 'naaaaaaame'
     function Meet({name = 'world'}) {
     	return <div>Hello, {name}</div>;
     }
+    function MeetAndGreet(k: {"prop-name": string}) {
+    	return <div>Hi Hi</div>;
+    }
     
     // OK
     let a = <Greet name='world' />;
+    let a1 = <Greet name='world' extra-prop />;
     // Error
     let b = <Greet naaame='world' />;
-            ~~~~~~~~~~~~~~~~~~~~~~~~
-!!! error TS2324: Property 'name' is missing in type 'IntrinsicAttributes & { name: string; }'.
-                   ~~~~~~
-!!! error TS2339: Property 'naaame' does not exist on type 'IntrinsicAttributes & { name: string; }'.
+                   ~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ naaame: "world"; }' is not assignable to type 'IntrinsicAttributes & { name: string; }'.
+!!! error TS2322:   Property 'naaame' does not exist on type 'IntrinsicAttributes & { name: string; }'.
     
     // OK
     let c = <Meet />;
+    let c1 = <Meet extra-prop/>;
     // OK
     let d = <Meet name='me' />;
     // Error
     let e = <Meet name={42} />;
                   ~~~~~~~~~
-!!! error TS2322: Type '42' is not assignable to type 'string'.
+!!! error TS2322: Type '{ name: 42; }' is not assignable to type 'IntrinsicAttributes & { name?: string; }'.
+!!! error TS2322:   Type '{ name: 42; }' is not assignable to type '{ name?: string; }'.
+!!! error TS2322:     Types of property 'name' are incompatible.
+!!! error TS2322:       Type '42' is not assignable to type 'string'.
     // Error
     let f = <Meet naaaaaaame='no' />;
-                  ~~~~~~~~~~
-!!! error TS2339: Property 'naaaaaaame' does not exist on type 'IntrinsicAttributes & { name?: string; }'.
+                  ~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{ naaaaaaame: "no"; }' is not assignable to type 'IntrinsicAttributes & { name?: string; }'.
+!!! error TS2322:   Property 'naaaaaaame' does not exist on type 'IntrinsicAttributes & { name?: string; }'.
+    
+    // OK
+    let g = <MeetAndGreet prop-name="Bob" />;
+    // Error
+    let h = <MeetAndGreet extra-prop-name="World" />;
+                          ~~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { "prop-name": string; }'.
+!!! error TS2322:   Type '{}' is not assignable to type '{ "prop-name": string; }'.
+!!! error TS2322:     Property '"prop-name"' is missing in type '{}'.
+    
     
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents1.js b/tests/baselines/reference/tsxStatelessFunctionComponents1.js
index 864e519f786c2..1f6a29736d76d 100644
--- a/tests/baselines/reference/tsxStatelessFunctionComponents1.js
+++ b/tests/baselines/reference/tsxStatelessFunctionComponents1.js
@@ -6,20 +6,31 @@ function Greet(x: {name: string}) {
 function Meet({name = 'world'}) {
 	return <div>Hello, {name}</div>;
 }
+function MeetAndGreet(k: {"prop-name": string}) {
+	return <div>Hi Hi</div>;
+}
 
 // OK
 let a = <Greet name='world' />;
+let a1 = <Greet name='world' extra-prop />;
 // Error
 let b = <Greet naaame='world' />;
 
 // OK
 let c = <Meet />;
+let c1 = <Meet extra-prop/>;
 // OK
 let d = <Meet name='me' />;
 // Error
 let e = <Meet name={42} />;
 // Error
 let f = <Meet naaaaaaame='no' />;
+
+// OK
+let g = <MeetAndGreet prop-name="Bob" />;
+// Error
+let h = <MeetAndGreet extra-prop-name="World" />;
+
 
 
 //// [file.jsx]
@@ -30,15 +41,24 @@ function Meet(_a) {
     var _b = _a.name, name = _b === void 0 ? 'world' : _b;
     return <div>Hello, {name}</div>;
 }
+function MeetAndGreet(k) {
+    return <div>Hi Hi</div>;
+}
 // OK
 var a = <Greet name='world'/>;
+var a1 = <Greet name='world' extra-prop/>;
 // Error
 var b = <Greet naaame='world'/>;
 // OK
 var c = <Meet />;
+var c1 = <Meet extra-prop/>;
 // OK
 var d = <Meet name='me'/>;
 // Error
 var e = <Meet name={42}/>;
 // Error
 var f = <Meet naaaaaaame='no'/>;
+// OK
+var g = <MeetAndGreet prop-name="Bob"/>;
+// Error
+var h = <MeetAndGreet extra-prop-name="World"/>;
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents2.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponents2.errors.txt
index f8a569838ee45..6cefda87834df 100644
--- a/tests/baselines/reference/tsxStatelessFunctionComponents2.errors.txt
+++ b/tests/baselines/reference/tsxStatelessFunctionComponents2.errors.txt
@@ -1,4 +1,5 @@
-tests/cases/conformance/jsx/file.tsx(20,16): error TS2339: Property 'ref' does not exist on type 'IntrinsicAttributes & { name?: string; }'.
+tests/cases/conformance/jsx/file.tsx(20,16): error TS2322: Type '{ ref: "myRef"; }' is not assignable to type 'IntrinsicAttributes & { name?: string; }'.
+  Property 'ref' does not exist on type 'IntrinsicAttributes & { name?: string; }'.
 tests/cases/conformance/jsx/file.tsx(26,42): error TS2339: Property 'subtr' does not exist on type 'string'.
 tests/cases/conformance/jsx/file.tsx(28,33): error TS2339: Property 'notARealProperty' does not exist on type 'BigGreeter'.
 tests/cases/conformance/jsx/file.tsx(36,26): error TS2339: Property 'propertyNotOnHtmlDivElement' does not exist on type 'HTMLDivElement'.
@@ -25,8 +26,9 @@ tests/cases/conformance/jsx/file.tsx(36,26): error TS2339: Property 'propertyNot
     let b = <Greet key="k" />;
     // Error - not allowed to specify 'ref' on SFCs
     let c = <Greet ref="myRef" />;
-                   ~~~
-!!! error TS2339: Property 'ref' does not exist on type 'IntrinsicAttributes & { name?: string; }'.
+                   ~~~~~~~~~~~
+!!! error TS2322: Type '{ ref: "myRef"; }' is not assignable to type 'IntrinsicAttributes & { name?: string; }'.
+!!! error TS2322:   Property 'ref' does not exist on type 'IntrinsicAttributes & { name?: string; }'.
     
     
     // OK - ref is valid for classes
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents3.symbols b/tests/baselines/reference/tsxStatelessFunctionComponents3.symbols
index 4ce502c6a6a08..d42d7aeaf1221 100644
--- a/tests/baselines/reference/tsxStatelessFunctionComponents3.symbols
+++ b/tests/baselines/reference/tsxStatelessFunctionComponents3.symbols
@@ -6,7 +6,7 @@ import React = require('react');
 const Foo = (props: any) => <div/>;
 >Foo : Symbol(Foo, Decl(file.tsx, 3, 5))
 >props : Symbol(props, Decl(file.tsx, 3, 13))
->div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 927, 45))
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
 
 // Should be OK
 const foo = <Foo />;
@@ -18,31 +18,31 @@ const foo = <Foo />;
 var MainMenu: React.StatelessComponent<{}> = (props) => (<div>
 >MainMenu : Symbol(MainMenu, Decl(file.tsx, 9, 3))
 >React : Symbol(React, Decl(file.tsx, 0, 0))
->StatelessComponent : Symbol(React.StatelessComponent, Decl(react.d.ts, 139, 5))
+>StatelessComponent : Symbol(React.StatelessComponent, Decl(react.d.ts, 197, 40))
 >props : Symbol(props, Decl(file.tsx, 9, 46))
->div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 927, 45))
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
 
     <h3>Main Menu</h3>
->h3 : Symbol(JSX.IntrinsicElements.h3, Decl(react.d.ts, 939, 48))
->h3 : Symbol(JSX.IntrinsicElements.h3, Decl(react.d.ts, 939, 48))
+>h3 : Symbol(JSX.IntrinsicElements.h3, Decl(react.d.ts, 2409, 48))
+>h3 : Symbol(JSX.IntrinsicElements.h3, Decl(react.d.ts, 2409, 48))
 
 </div>);
->div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 927, 45))
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
 
 var App: React.StatelessComponent<{ children }> = ({children}) => (
 >App : Symbol(App, Decl(file.tsx, 13, 3))
 >React : Symbol(React, Decl(file.tsx, 0, 0))
->StatelessComponent : Symbol(React.StatelessComponent, Decl(react.d.ts, 139, 5))
+>StatelessComponent : Symbol(React.StatelessComponent, Decl(react.d.ts, 197, 40))
 >children : Symbol(children, Decl(file.tsx, 13, 35))
 >children : Symbol(children, Decl(file.tsx, 13, 52))
 
     <div >
->div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 927, 45))
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
 
         <MainMenu/>
 >MainMenu : Symbol(MainMenu, Decl(file.tsx, 9, 3))
 
 	</div>
->div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 927, 45))
+>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
 
 );
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments1.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments1.errors.txt
new file mode 100644
index 0000000000000..dd628c6de0e9c
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments1.errors.txt
@@ -0,0 +1,59 @@
+tests/cases/conformance/jsx/file.tsx(16,25): error TS2698: Spread types may only be created from object types.
+tests/cases/conformance/jsx/file.tsx(17,25): error TS2698: Spread types may only be created from object types.
+tests/cases/conformance/jsx/file.tsx(25,33): error TS2698: Spread types may only be created from object types.
+tests/cases/conformance/jsx/file.tsx(26,34): error TS2698: Spread types may only be created from object types.
+tests/cases/conformance/jsx/file.tsx(27,33): error TS2698: Spread types may only be created from object types.
+
+
+==== tests/cases/conformance/jsx/file.tsx (5 errors) ====
+    
+    import React = require('react')
+    
+    
+    declare function ComponentWithTwoAttributes<K,V>(l: {key1: K, value: V}): JSX.Element;
+    
+    // OK
+    function Baz<T,U>(key1: T, value: U) {
+        let a0 = <ComponentWithTwoAttributes key1={key1} value={value} />
+        let a1 = <ComponentWithTwoAttributes {...{key1, value: value}} key="Component" />
+    }
+    
+    // OK
+    declare function Component<U>(l: U): JSX.Element;
+    function createComponent<T extends {prop: number}>(arg:T) {
+        let a1 = <Component {...arg} />;
+                            ~~~~~~~~
+!!! error TS2698: Spread types may only be created from object types.
+        let a2 = <Component {...arg} prop1 />;
+                            ~~~~~~~~
+!!! error TS2698: Spread types may only be created from object types.
+    }
+    
+    declare function ComponentSpecific<U>(l: {prop: U}): JSX.Element;
+    declare function ComponentSpecific1<U>(l: {prop: U, "ignore-prop": number}): JSX.Element;
+    
+    // OK
+    function Bar<T extends {prop: number}>(arg: T) {
+        let a1 = <ComponentSpecific {...arg} ignore-prop="hi" />;  // U is number
+                                    ~~~~~~~~
+!!! error TS2698: Spread types may only be created from object types.
+        let a2 = <ComponentSpecific1 {...arg} ignore-prop={10} />;  // U is number
+                                     ~~~~~~~~
+!!! error TS2698: Spread types may only be created from object types.
+        let a3 = <ComponentSpecific {...arg} prop="hello" />;   // U is "hello"
+                                    ~~~~~~~~
+!!! error TS2698: Spread types may only be created from object types.
+    }
+    
+    declare function Link<U>(l: {func: (arg: U)=>void}): JSX.Element;
+    
+    // OK
+    function createLink(func: (a: number)=>void) {
+        let o = <Link func={func} />
+    }
+    
+    function createLink1(func: (a: number)=>boolean) {
+        let o = <Link func={func} />
+    }
+    
+    
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments1.js b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments1.js
new file mode 100644
index 0000000000000..ab9171b8ed146
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments1.js
@@ -0,0 +1,69 @@
+//// [file.tsx]
+
+import React = require('react')
+
+
+declare function ComponentWithTwoAttributes<K,V>(l: {key1: K, value: V}): JSX.Element;
+
+// OK
+function Baz<T,U>(key1: T, value: U) {
+    let a0 = <ComponentWithTwoAttributes key1={key1} value={value} />
+    let a1 = <ComponentWithTwoAttributes {...{key1, value: value}} key="Component" />
+}
+
+// OK
+declare function Component<U>(l: U): JSX.Element;
+function createComponent<T extends {prop: number}>(arg:T) {
+    let a1 = <Component {...arg} />;
+    let a2 = <Component {...arg} prop1 />;
+}
+
+declare function ComponentSpecific<U>(l: {prop: U}): JSX.Element;
+declare function ComponentSpecific1<U>(l: {prop: U, "ignore-prop": number}): JSX.Element;
+
+// OK
+function Bar<T extends {prop: number}>(arg: T) {
+    let a1 = <ComponentSpecific {...arg} ignore-prop="hi" />;  // U is number
+    let a2 = <ComponentSpecific1 {...arg} ignore-prop={10} />;  // U is number
+    let a3 = <ComponentSpecific {...arg} prop="hello" />;   // U is "hello"
+}
+
+declare function Link<U>(l: {func: (arg: U)=>void}): JSX.Element;
+
+// OK
+function createLink(func: (a: number)=>void) {
+    let o = <Link func={func} />
+}
+
+function createLink1(func: (a: number)=>boolean) {
+    let o = <Link func={func} />
+}
+
+
+
+//// [file.jsx]
+define(["require", "exports", "react"], function (require, exports, React) {
+    "use strict";
+    // OK
+    function Baz(key1, value) {
+        var a0 = <ComponentWithTwoAttributes key1={key1} value={value}/>;
+        var a1 = <ComponentWithTwoAttributes {...{ key1: key1, value: value }} key="Component"/>;
+    }
+    function createComponent(arg) {
+        var a1 = <Component {...arg}/>;
+        var a2 = <Component {...arg} prop1/>;
+    }
+    // OK
+    function Bar(arg) {
+        var a1 = <ComponentSpecific {...arg} ignore-prop="hi"/>; // U is number
+        var a2 = <ComponentSpecific1 {...arg} ignore-prop={10}/>; // U is number
+        var a3 = <ComponentSpecific {...arg} prop="hello"/>; // U is "hello"
+    }
+    // OK
+    function createLink(func) {
+        var o = <Link func={func}/>;
+    }
+    function createLink1(func) {
+        var o = <Link func={func}/>;
+    }
+});
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments1.symbols b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments1.symbols
new file mode 100644
index 0000000000000..88654281891f4
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments1.symbols
@@ -0,0 +1,154 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react')
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+
+
+declare function ComponentWithTwoAttributes<K,V>(l: {key1: K, value: V}): JSX.Element;
+>ComponentWithTwoAttributes : Symbol(ComponentWithTwoAttributes, Decl(file.tsx, 1, 31))
+>K : Symbol(K, Decl(file.tsx, 4, 44))
+>V : Symbol(V, Decl(file.tsx, 4, 46))
+>l : Symbol(l, Decl(file.tsx, 4, 49))
+>key1 : Symbol(key1, Decl(file.tsx, 4, 53))
+>K : Symbol(K, Decl(file.tsx, 4, 44))
+>value : Symbol(value, Decl(file.tsx, 4, 61))
+>V : Symbol(V, Decl(file.tsx, 4, 46))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+// OK
+function Baz<T,U>(key1: T, value: U) {
+>Baz : Symbol(Baz, Decl(file.tsx, 4, 86))
+>T : Symbol(T, Decl(file.tsx, 7, 13))
+>U : Symbol(U, Decl(file.tsx, 7, 15))
+>key1 : Symbol(key1, Decl(file.tsx, 7, 18))
+>T : Symbol(T, Decl(file.tsx, 7, 13))
+>value : Symbol(value, Decl(file.tsx, 7, 26))
+>U : Symbol(U, Decl(file.tsx, 7, 15))
+
+    let a0 = <ComponentWithTwoAttributes key1={key1} value={value} />
+>a0 : Symbol(a0, Decl(file.tsx, 8, 7))
+>ComponentWithTwoAttributes : Symbol(ComponentWithTwoAttributes, Decl(file.tsx, 1, 31))
+>key1 : Symbol(key1, Decl(file.tsx, 8, 40))
+>key1 : Symbol(key1, Decl(file.tsx, 7, 18))
+>value : Symbol(value, Decl(file.tsx, 8, 52))
+>value : Symbol(value, Decl(file.tsx, 7, 26))
+
+    let a1 = <ComponentWithTwoAttributes {...{key1, value: value}} key="Component" />
+>a1 : Symbol(a1, Decl(file.tsx, 9, 7))
+>ComponentWithTwoAttributes : Symbol(ComponentWithTwoAttributes, Decl(file.tsx, 1, 31))
+>key1 : Symbol(key1, Decl(file.tsx, 9, 46))
+>value : Symbol(value, Decl(file.tsx, 9, 51))
+>value : Symbol(value, Decl(file.tsx, 7, 26))
+>key : Symbol(key, Decl(file.tsx, 9, 66))
+}
+
+// OK
+declare function Component<U>(l: U): JSX.Element;
+>Component : Symbol(Component, Decl(file.tsx, 10, 1))
+>U : Symbol(U, Decl(file.tsx, 13, 27))
+>l : Symbol(l, Decl(file.tsx, 13, 30))
+>U : Symbol(U, Decl(file.tsx, 13, 27))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+function createComponent<T extends {prop: number}>(arg:T) {
+>createComponent : Symbol(createComponent, Decl(file.tsx, 13, 49))
+>T : Symbol(T, Decl(file.tsx, 14, 25))
+>prop : Symbol(prop, Decl(file.tsx, 14, 36))
+>arg : Symbol(arg, Decl(file.tsx, 14, 51))
+>T : Symbol(T, Decl(file.tsx, 14, 25))
+
+    let a1 = <Component {...arg} />;
+>a1 : Symbol(a1, Decl(file.tsx, 15, 7))
+>Component : Symbol(Component, Decl(file.tsx, 10, 1))
+>arg : Symbol(arg, Decl(file.tsx, 14, 51))
+
+    let a2 = <Component {...arg} prop1 />;
+>a2 : Symbol(a2, Decl(file.tsx, 16, 7))
+>Component : Symbol(Component, Decl(file.tsx, 10, 1))
+>arg : Symbol(arg, Decl(file.tsx, 14, 51))
+>prop1 : Symbol(prop1, Decl(file.tsx, 16, 32))
+}
+
+declare function ComponentSpecific<U>(l: {prop: U}): JSX.Element;
+>ComponentSpecific : Symbol(ComponentSpecific, Decl(file.tsx, 17, 1))
+>U : Symbol(U, Decl(file.tsx, 19, 35))
+>l : Symbol(l, Decl(file.tsx, 19, 38))
+>prop : Symbol(prop, Decl(file.tsx, 19, 42))
+>U : Symbol(U, Decl(file.tsx, 19, 35))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+declare function ComponentSpecific1<U>(l: {prop: U, "ignore-prop": number}): JSX.Element;
+>ComponentSpecific1 : Symbol(ComponentSpecific1, Decl(file.tsx, 19, 65))
+>U : Symbol(U, Decl(file.tsx, 20, 36))
+>l : Symbol(l, Decl(file.tsx, 20, 39))
+>prop : Symbol(prop, Decl(file.tsx, 20, 43))
+>U : Symbol(U, Decl(file.tsx, 20, 36))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+// OK
+function Bar<T extends {prop: number}>(arg: T) {
+>Bar : Symbol(Bar, Decl(file.tsx, 20, 89))
+>T : Symbol(T, Decl(file.tsx, 23, 13))
+>prop : Symbol(prop, Decl(file.tsx, 23, 24))
+>arg : Symbol(arg, Decl(file.tsx, 23, 39))
+>T : Symbol(T, Decl(file.tsx, 23, 13))
+
+    let a1 = <ComponentSpecific {...arg} ignore-prop="hi" />;  // U is number
+>a1 : Symbol(a1, Decl(file.tsx, 24, 7))
+>ComponentSpecific : Symbol(ComponentSpecific, Decl(file.tsx, 17, 1))
+>arg : Symbol(arg, Decl(file.tsx, 23, 39))
+>ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 24, 40))
+
+    let a2 = <ComponentSpecific1 {...arg} ignore-prop={10} />;  // U is number
+>a2 : Symbol(a2, Decl(file.tsx, 25, 7))
+>ComponentSpecific1 : Symbol(ComponentSpecific1, Decl(file.tsx, 19, 65))
+>arg : Symbol(arg, Decl(file.tsx, 23, 39))
+>ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 25, 41))
+
+    let a3 = <ComponentSpecific {...arg} prop="hello" />;   // U is "hello"
+>a3 : Symbol(a3, Decl(file.tsx, 26, 7))
+>ComponentSpecific : Symbol(ComponentSpecific, Decl(file.tsx, 17, 1))
+>arg : Symbol(arg, Decl(file.tsx, 23, 39))
+>prop : Symbol(prop, Decl(file.tsx, 26, 40))
+}
+
+declare function Link<U>(l: {func: (arg: U)=>void}): JSX.Element;
+>Link : Symbol(Link, Decl(file.tsx, 27, 1))
+>U : Symbol(U, Decl(file.tsx, 29, 22))
+>l : Symbol(l, Decl(file.tsx, 29, 25))
+>func : Symbol(func, Decl(file.tsx, 29, 29))
+>arg : Symbol(arg, Decl(file.tsx, 29, 36))
+>U : Symbol(U, Decl(file.tsx, 29, 22))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+// OK
+function createLink(func: (a: number)=>void) {
+>createLink : Symbol(createLink, Decl(file.tsx, 29, 65))
+>func : Symbol(func, Decl(file.tsx, 32, 20))
+>a : Symbol(a, Decl(file.tsx, 32, 27))
+
+    let o = <Link func={func} />
+>o : Symbol(o, Decl(file.tsx, 33, 7))
+>Link : Symbol(Link, Decl(file.tsx, 27, 1))
+>func : Symbol(func, Decl(file.tsx, 33, 17))
+>func : Symbol(func, Decl(file.tsx, 32, 20))
+}
+
+function createLink1(func: (a: number)=>boolean) {
+>createLink1 : Symbol(createLink1, Decl(file.tsx, 34, 1))
+>func : Symbol(func, Decl(file.tsx, 36, 21))
+>a : Symbol(a, Decl(file.tsx, 36, 28))
+
+    let o = <Link func={func} />
+>o : Symbol(o, Decl(file.tsx, 37, 7))
+>Link : Symbol(Link, Decl(file.tsx, 27, 1))
+>func : Symbol(func, Decl(file.tsx, 37, 17))
+>func : Symbol(func, Decl(file.tsx, 36, 21))
+}
+
+
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments1.types b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments1.types
new file mode 100644
index 0000000000000..c1bf05c0fa53b
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments1.types
@@ -0,0 +1,165 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react')
+>React : typeof React
+
+
+declare function ComponentWithTwoAttributes<K,V>(l: {key1: K, value: V}): JSX.Element;
+>ComponentWithTwoAttributes : <K, V>(l: { key1: K; value: V; }) => JSX.Element
+>K : K
+>V : V
+>l : { key1: K; value: V; }
+>key1 : K
+>K : K
+>value : V
+>V : V
+>JSX : any
+>Element : JSX.Element
+
+// OK
+function Baz<T,U>(key1: T, value: U) {
+>Baz : <T, U>(key1: T, value: U) => void
+>T : T
+>U : U
+>key1 : T
+>T : T
+>value : U
+>U : U
+
+    let a0 = <ComponentWithTwoAttributes key1={key1} value={value} />
+>a0 : JSX.Element
+><ComponentWithTwoAttributes key1={key1} value={value} /> : JSX.Element
+>ComponentWithTwoAttributes : <K, V>(l: { key1: K; value: V; }) => JSX.Element
+>key1 : T
+>key1 : T
+>value : U
+>value : U
+
+    let a1 = <ComponentWithTwoAttributes {...{key1, value: value}} key="Component" />
+>a1 : JSX.Element
+><ComponentWithTwoAttributes {...{key1, value: value}} key="Component" /> : JSX.Element
+>ComponentWithTwoAttributes : <K, V>(l: { key1: K; value: V; }) => JSX.Element
+>{key1, value: value} : { key1: T; value: U; }
+>key1 : T
+>value : U
+>value : U
+>key : string
+}
+
+// OK
+declare function Component<U>(l: U): JSX.Element;
+>Component : <U>(l: U) => JSX.Element
+>U : U
+>l : U
+>U : U
+>JSX : any
+>Element : JSX.Element
+
+function createComponent<T extends {prop: number}>(arg:T) {
+>createComponent : <T extends { prop: number; }>(arg: T) => void
+>T : T
+>prop : number
+>arg : T
+>T : T
+
+    let a1 = <Component {...arg} />;
+>a1 : JSX.Element
+><Component {...arg} /> : JSX.Element
+>Component : <U>(l: U) => JSX.Element
+>arg : T
+
+    let a2 = <Component {...arg} prop1 />;
+>a2 : JSX.Element
+><Component {...arg} prop1 /> : JSX.Element
+>Component : <U>(l: U) => JSX.Element
+>arg : T
+>prop1 : true
+}
+
+declare function ComponentSpecific<U>(l: {prop: U}): JSX.Element;
+>ComponentSpecific : <U>(l: { prop: U; }) => JSX.Element
+>U : U
+>l : { prop: U; }
+>prop : U
+>U : U
+>JSX : any
+>Element : JSX.Element
+
+declare function ComponentSpecific1<U>(l: {prop: U, "ignore-prop": number}): JSX.Element;
+>ComponentSpecific1 : <U>(l: { prop: U; "ignore-prop": number; }) => JSX.Element
+>U : U
+>l : { prop: U; "ignore-prop": number; }
+>prop : U
+>U : U
+>JSX : any
+>Element : JSX.Element
+
+// OK
+function Bar<T extends {prop: number}>(arg: T) {
+>Bar : <T extends { prop: number; }>(arg: T) => void
+>T : T
+>prop : number
+>arg : T
+>T : T
+
+    let a1 = <ComponentSpecific {...arg} ignore-prop="hi" />;  // U is number
+>a1 : JSX.Element
+><ComponentSpecific {...arg} ignore-prop="hi" /> : JSX.Element
+>ComponentSpecific : <U>(l: { prop: U; }) => JSX.Element
+>arg : T
+>ignore-prop : string
+
+    let a2 = <ComponentSpecific1 {...arg} ignore-prop={10} />;  // U is number
+>a2 : JSX.Element
+><ComponentSpecific1 {...arg} ignore-prop={10} /> : JSX.Element
+>ComponentSpecific1 : <U>(l: { prop: U; "ignore-prop": number; }) => JSX.Element
+>arg : T
+>ignore-prop : number
+>10 : 10
+
+    let a3 = <ComponentSpecific {...arg} prop="hello" />;   // U is "hello"
+>a3 : JSX.Element
+><ComponentSpecific {...arg} prop="hello" /> : JSX.Element
+>ComponentSpecific : <U>(l: { prop: U; }) => JSX.Element
+>arg : T
+>prop : string
+}
+
+declare function Link<U>(l: {func: (arg: U)=>void}): JSX.Element;
+>Link : <U>(l: { func: (arg: U) => void; }) => JSX.Element
+>U : U
+>l : { func: (arg: U) => void; }
+>func : (arg: U) => void
+>arg : U
+>U : U
+>JSX : any
+>Element : JSX.Element
+
+// OK
+function createLink(func: (a: number)=>void) {
+>createLink : (func: (a: number) => void) => void
+>func : (a: number) => void
+>a : number
+
+    let o = <Link func={func} />
+>o : JSX.Element
+><Link func={func} /> : JSX.Element
+>Link : <U>(l: { func: (arg: U) => void; }) => JSX.Element
+>func : (a: number) => void
+>func : (a: number) => void
+}
+
+function createLink1(func: (a: number)=>boolean) {
+>createLink1 : (func: (a: number) => boolean) => void
+>func : (a: number) => boolean
+>a : number
+
+    let o = <Link func={func} />
+>o : JSX.Element
+><Link func={func} /> : JSX.Element
+>Link : <U>(l: { func: (arg: U) => void; }) => JSX.Element
+>func : (a: number) => boolean
+>func : (a: number) => boolean
+}
+
+
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt
new file mode 100644
index 0000000000000..98fa75d99a17f
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt
@@ -0,0 +1,40 @@
+tests/cases/conformance/jsx/file.tsx(9,34): error TS2698: Spread types may only be created from object types.
+tests/cases/conformance/jsx/file.tsx(14,34): error TS2698: Spread types may only be created from object types.
+tests/cases/conformance/jsx/file.tsx(21,19): error TS2322: Type '{ func: (a: number, b: string) => void; }' is not assignable to type 'IntrinsicAttributes & { func: (arg: number) => void; }'.
+  Type '{ func: (a: number, b: string) => void; }' is not assignable to type '{ func: (arg: number) => void; }'.
+    Types of property 'func' are incompatible.
+      Type '(a: number, b: string) => void' is not assignable to type '(arg: number) => void'.
+
+
+==== tests/cases/conformance/jsx/file.tsx (3 errors) ====
+    
+    import React = require('react')
+    
+    declare function ComponentSpecific1<U>(l: {prop: U, "ignore-prop": string}): JSX.Element;
+    declare function ComponentSpecific2<U>(l: {prop: U}): JSX.Element;
+    
+    // Error
+    function Bar<T extends {prop: number}>(arg: T) {
+        let a1 = <ComponentSpecific1 {...arg} ignore-prop={10} />;
+                                     ~~~~~~~~
+!!! error TS2698: Spread types may only be created from object types.
+     }
+    
+    // Error
+    function Baz<T>(arg: T) {
+        let a0 = <ComponentSpecific1 {...arg} />
+                                     ~~~~~~~~
+!!! error TS2698: Spread types may only be created from object types.
+    }
+    
+    declare function Link<U>(l: {func: (arg: U)=>void}): JSX.Element;
+    
+    // Error
+    function createLink(func: (a: number, b: string)=>void) {
+        let o = <Link func={func} />
+                      ~~~~~~~~~~~
+!!! error TS2322: Type '{ func: (a: number, b: string) => void; }' is not assignable to type 'IntrinsicAttributes & { func: (arg: number) => void; }'.
+!!! error TS2322:   Type '{ func: (a: number, b: string) => void; }' is not assignable to type '{ func: (arg: number) => void; }'.
+!!! error TS2322:     Types of property 'func' are incompatible.
+!!! error TS2322:       Type '(a: number, b: string) => void' is not assignable to type '(arg: number) => void'.
+    }
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.js b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.js
new file mode 100644
index 0000000000000..a42f7ac176837
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.js
@@ -0,0 +1,40 @@
+//// [file.tsx]
+
+import React = require('react')
+
+declare function ComponentSpecific1<U>(l: {prop: U, "ignore-prop": string}): JSX.Element;
+declare function ComponentSpecific2<U>(l: {prop: U}): JSX.Element;
+
+// Error
+function Bar<T extends {prop: number}>(arg: T) {
+    let a1 = <ComponentSpecific1 {...arg} ignore-prop={10} />;
+ }
+
+// Error
+function Baz<T>(arg: T) {
+    let a0 = <ComponentSpecific1 {...arg} />
+}
+
+declare function Link<U>(l: {func: (arg: U)=>void}): JSX.Element;
+
+// Error
+function createLink(func: (a: number, b: string)=>void) {
+    let o = <Link func={func} />
+}
+
+//// [file.jsx]
+define(["require", "exports", "react"], function (require, exports, React) {
+    "use strict";
+    // Error
+    function Bar(arg) {
+        var a1 = <ComponentSpecific1 {...arg} ignore-prop={10}/>;
+    }
+    // Error
+    function Baz(arg) {
+        var a0 = <ComponentSpecific1 {...arg}/>;
+    }
+    // Error
+    function createLink(func) {
+        var o = <Link func={func}/>;
+    }
+});
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments3.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments3.errors.txt
new file mode 100644
index 0000000000000..53d11be4ef96d
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments3.errors.txt
@@ -0,0 +1,45 @@
+tests/cases/conformance/jsx/file.tsx(10,33): error TS2698: Spread types may only be created from object types.
+tests/cases/conformance/jsx/file.tsx(11,33): error TS2698: Spread types may only be created from object types.
+tests/cases/conformance/jsx/file.tsx(12,33): error TS2698: Spread types may only be created from object types.
+tests/cases/conformance/jsx/file.tsx(13,33): error TS2698: Spread types may only be created from object types.
+tests/cases/conformance/jsx/file.tsx(15,33): error TS2698: Spread types may only be created from object types.
+tests/cases/conformance/jsx/file.tsx(16,33): error TS2698: Spread types may only be created from object types.
+
+
+==== tests/cases/conformance/jsx/file.tsx (6 errors) ====
+    
+    import React = require('react')
+    
+    declare function OverloadComponent<U>(): JSX.Element;
+    declare function OverloadComponent<U>(attr: {b: U, a?: string, "ignore-prop": boolean}): JSX.Element;
+    declare function OverloadComponent<T, U>(attr: {b: U, a: T}): JSX.Element;
+    
+    // OK
+    function Baz<T extends {b: number}, U extends {a: boolean, b:string}>(arg1: T, arg2: U) {
+        let a0 = <OverloadComponent {...arg1} a="hello" ignore-prop />;
+                                    ~~~~~~~~~
+!!! error TS2698: Spread types may only be created from object types.
+        let a1 = <OverloadComponent {...arg2} ignore-pro="hello world" />;
+                                    ~~~~~~~~~
+!!! error TS2698: Spread types may only be created from object types.
+        let a2 = <OverloadComponent {...arg2} />;
+                                    ~~~~~~~~~
+!!! error TS2698: Spread types may only be created from object types.
+        let a3 = <OverloadComponent {...arg1} ignore-prop />;
+                                    ~~~~~~~~~
+!!! error TS2698: Spread types may only be created from object types.
+        let a4 = <OverloadComponent />;
+        let a5 = <OverloadComponent {...arg2} ignore-prop="hello" {...arg1} />;
+                                    ~~~~~~~~~
+!!! error TS2698: Spread types may only be created from object types.
+        let a6 = <OverloadComponent {...arg2} ignore-prop {...arg1} />;
+                                    ~~~~~~~~~
+!!! error TS2698: Spread types may only be created from object types.
+    }
+    
+    declare function Link<U>(l: {func: (arg: U)=>void}): JSX.Element;
+    declare function Link<U>(l: {func: (arg1:U, arg2: string)=>void}): JSX.Element;
+    function createLink(func: (a: number)=>void) {
+        let o = <Link func={func} />
+        let o1 = <Link func={(a:number, b:string)=>{}} />;
+    }
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments3.js b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments3.js
new file mode 100644
index 0000000000000..8eaf5d2015e93
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments3.js
@@ -0,0 +1,44 @@
+//// [file.tsx]
+
+import React = require('react')
+
+declare function OverloadComponent<U>(): JSX.Element;
+declare function OverloadComponent<U>(attr: {b: U, a?: string, "ignore-prop": boolean}): JSX.Element;
+declare function OverloadComponent<T, U>(attr: {b: U, a: T}): JSX.Element;
+
+// OK
+function Baz<T extends {b: number}, U extends {a: boolean, b:string}>(arg1: T, arg2: U) {
+    let a0 = <OverloadComponent {...arg1} a="hello" ignore-prop />;
+    let a1 = <OverloadComponent {...arg2} ignore-pro="hello world" />;
+    let a2 = <OverloadComponent {...arg2} />;
+    let a3 = <OverloadComponent {...arg1} ignore-prop />;
+    let a4 = <OverloadComponent />;
+    let a5 = <OverloadComponent {...arg2} ignore-prop="hello" {...arg1} />;
+    let a6 = <OverloadComponent {...arg2} ignore-prop {...arg1} />;
+}
+
+declare function Link<U>(l: {func: (arg: U)=>void}): JSX.Element;
+declare function Link<U>(l: {func: (arg1:U, arg2: string)=>void}): JSX.Element;
+function createLink(func: (a: number)=>void) {
+    let o = <Link func={func} />
+    let o1 = <Link func={(a:number, b:string)=>{}} />;
+}
+
+//// [file.jsx]
+define(["require", "exports", "react"], function (require, exports, React) {
+    "use strict";
+    // OK
+    function Baz(arg1, arg2) {
+        var a0 = <OverloadComponent {...arg1} a="hello" ignore-prop/>;
+        var a1 = <OverloadComponent {...arg2} ignore-pro="hello world"/>;
+        var a2 = <OverloadComponent {...arg2}/>;
+        var a3 = <OverloadComponent {...arg1} ignore-prop/>;
+        var a4 = <OverloadComponent />;
+        var a5 = <OverloadComponent {...arg2} ignore-prop="hello" {...arg1}/>;
+        var a6 = <OverloadComponent {...arg2} ignore-prop {...arg1}/>;
+    }
+    function createLink(func) {
+        var o = <Link func={func}/>;
+        var o1 = <Link func={function (a, b) { }}/>;
+    }
+});
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments3.symbols b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments3.symbols
new file mode 100644
index 0000000000000..ebd80b3d262d6
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments3.symbols
@@ -0,0 +1,128 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react')
+>React : Symbol(React, Decl(file.tsx, 0, 0))
+
+declare function OverloadComponent<U>(): JSX.Element;
+>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101))
+>U : Symbol(U, Decl(file.tsx, 3, 35))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+declare function OverloadComponent<U>(attr: {b: U, a?: string, "ignore-prop": boolean}): JSX.Element;
+>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101))
+>U : Symbol(U, Decl(file.tsx, 4, 35))
+>attr : Symbol(attr, Decl(file.tsx, 4, 38))
+>b : Symbol(b, Decl(file.tsx, 4, 45))
+>U : Symbol(U, Decl(file.tsx, 4, 35))
+>a : Symbol(a, Decl(file.tsx, 4, 50))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+declare function OverloadComponent<T, U>(attr: {b: U, a: T}): JSX.Element;
+>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101))
+>T : Symbol(T, Decl(file.tsx, 5, 35))
+>U : Symbol(U, Decl(file.tsx, 5, 37))
+>attr : Symbol(attr, Decl(file.tsx, 5, 41))
+>b : Symbol(b, Decl(file.tsx, 5, 48))
+>U : Symbol(U, Decl(file.tsx, 5, 37))
+>a : Symbol(a, Decl(file.tsx, 5, 53))
+>T : Symbol(T, Decl(file.tsx, 5, 35))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+// OK
+function Baz<T extends {b: number}, U extends {a: boolean, b:string}>(arg1: T, arg2: U) {
+>Baz : Symbol(Baz, Decl(file.tsx, 5, 74))
+>T : Symbol(T, Decl(file.tsx, 8, 13))
+>b : Symbol(b, Decl(file.tsx, 8, 24))
+>U : Symbol(U, Decl(file.tsx, 8, 35))
+>a : Symbol(a, Decl(file.tsx, 8, 47))
+>b : Symbol(b, Decl(file.tsx, 8, 58))
+>arg1 : Symbol(arg1, Decl(file.tsx, 8, 70))
+>T : Symbol(T, Decl(file.tsx, 8, 13))
+>arg2 : Symbol(arg2, Decl(file.tsx, 8, 78))
+>U : Symbol(U, Decl(file.tsx, 8, 35))
+
+    let a0 = <OverloadComponent {...arg1} a="hello" ignore-prop />;
+>a0 : Symbol(a0, Decl(file.tsx, 9, 7))
+>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101))
+>arg1 : Symbol(arg1, Decl(file.tsx, 8, 70))
+>a : Symbol(a, Decl(file.tsx, 9, 41))
+>ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 9, 51))
+
+    let a1 = <OverloadComponent {...arg2} ignore-pro="hello world" />;
+>a1 : Symbol(a1, Decl(file.tsx, 10, 7))
+>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101))
+>arg2 : Symbol(arg2, Decl(file.tsx, 8, 78))
+>ignore-pro : Symbol(ignore-pro, Decl(file.tsx, 10, 41))
+
+    let a2 = <OverloadComponent {...arg2} />;
+>a2 : Symbol(a2, Decl(file.tsx, 11, 7))
+>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101))
+>arg2 : Symbol(arg2, Decl(file.tsx, 8, 78))
+
+    let a3 = <OverloadComponent {...arg1} ignore-prop />;
+>a3 : Symbol(a3, Decl(file.tsx, 12, 7))
+>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101))
+>arg1 : Symbol(arg1, Decl(file.tsx, 8, 70))
+>ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 12, 41))
+
+    let a4 = <OverloadComponent />;
+>a4 : Symbol(a4, Decl(file.tsx, 13, 7))
+>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101))
+
+    let a5 = <OverloadComponent {...arg2} ignore-prop="hello" {...arg1} />;
+>a5 : Symbol(a5, Decl(file.tsx, 14, 7))
+>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101))
+>arg2 : Symbol(arg2, Decl(file.tsx, 8, 78))
+>ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 14, 41))
+>arg1 : Symbol(arg1, Decl(file.tsx, 8, 70))
+
+    let a6 = <OverloadComponent {...arg2} ignore-prop {...arg1} />;
+>a6 : Symbol(a6, Decl(file.tsx, 15, 7))
+>OverloadComponent : Symbol(OverloadComponent, Decl(file.tsx, 1, 31), Decl(file.tsx, 3, 53), Decl(file.tsx, 4, 101))
+>arg2 : Symbol(arg2, Decl(file.tsx, 8, 78))
+>ignore-prop : Symbol(ignore-prop, Decl(file.tsx, 15, 41))
+>arg1 : Symbol(arg1, Decl(file.tsx, 8, 70))
+}
+
+declare function Link<U>(l: {func: (arg: U)=>void}): JSX.Element;
+>Link : Symbol(Link, Decl(file.tsx, 16, 1), Decl(file.tsx, 18, 65))
+>U : Symbol(U, Decl(file.tsx, 18, 22))
+>l : Symbol(l, Decl(file.tsx, 18, 25))
+>func : Symbol(func, Decl(file.tsx, 18, 29))
+>arg : Symbol(arg, Decl(file.tsx, 18, 36))
+>U : Symbol(U, Decl(file.tsx, 18, 22))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+declare function Link<U>(l: {func: (arg1:U, arg2: string)=>void}): JSX.Element;
+>Link : Symbol(Link, Decl(file.tsx, 16, 1), Decl(file.tsx, 18, 65))
+>U : Symbol(U, Decl(file.tsx, 19, 22))
+>l : Symbol(l, Decl(file.tsx, 19, 25))
+>func : Symbol(func, Decl(file.tsx, 19, 29))
+>arg1 : Symbol(arg1, Decl(file.tsx, 19, 36))
+>U : Symbol(U, Decl(file.tsx, 19, 22))
+>arg2 : Symbol(arg2, Decl(file.tsx, 19, 43))
+>JSX : Symbol(JSX, Decl(react.d.ts, 2352, 1))
+>Element : Symbol(JSX.Element, Decl(react.d.ts, 2355, 27))
+
+function createLink(func: (a: number)=>void) {
+>createLink : Symbol(createLink, Decl(file.tsx, 19, 79))
+>func : Symbol(func, Decl(file.tsx, 20, 20))
+>a : Symbol(a, Decl(file.tsx, 20, 27))
+
+    let o = <Link func={func} />
+>o : Symbol(o, Decl(file.tsx, 21, 7))
+>Link : Symbol(Link, Decl(file.tsx, 16, 1), Decl(file.tsx, 18, 65))
+>func : Symbol(func, Decl(file.tsx, 21, 17))
+>func : Symbol(func, Decl(file.tsx, 20, 20))
+
+    let o1 = <Link func={(a:number, b:string)=>{}} />;
+>o1 : Symbol(o1, Decl(file.tsx, 22, 7))
+>Link : Symbol(Link, Decl(file.tsx, 16, 1), Decl(file.tsx, 18, 65))
+>func : Symbol(func, Decl(file.tsx, 22, 18))
+>a : Symbol(a, Decl(file.tsx, 22, 26))
+>b : Symbol(b, Decl(file.tsx, 22, 35))
+}
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments3.types b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments3.types
new file mode 100644
index 0000000000000..f85638d0eddd5
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments3.types
@@ -0,0 +1,138 @@
+=== tests/cases/conformance/jsx/file.tsx ===
+
+import React = require('react')
+>React : typeof React
+
+declare function OverloadComponent<U>(): JSX.Element;
+>OverloadComponent : { <U>(): JSX.Element; <U>(attr: { b: U; a?: string; "ignore-prop": boolean; }): JSX.Element; <T, U>(attr: { b: U; a: T; }): JSX.Element; }
+>U : U
+>JSX : any
+>Element : JSX.Element
+
+declare function OverloadComponent<U>(attr: {b: U, a?: string, "ignore-prop": boolean}): JSX.Element;
+>OverloadComponent : { <U>(): JSX.Element; <U>(attr: { b: U; a?: string; "ignore-prop": boolean; }): JSX.Element; <T, U>(attr: { b: U; a: T; }): JSX.Element; }
+>U : U
+>attr : { b: U; a?: string; "ignore-prop": boolean; }
+>b : U
+>U : U
+>a : string
+>JSX : any
+>Element : JSX.Element
+
+declare function OverloadComponent<T, U>(attr: {b: U, a: T}): JSX.Element;
+>OverloadComponent : { <U>(): JSX.Element; <U>(attr: { b: U; a?: string; "ignore-prop": boolean; }): JSX.Element; <T, U>(attr: { b: U; a: T; }): JSX.Element; }
+>T : T
+>U : U
+>attr : { b: U; a: T; }
+>b : U
+>U : U
+>a : T
+>T : T
+>JSX : any
+>Element : JSX.Element
+
+// OK
+function Baz<T extends {b: number}, U extends {a: boolean, b:string}>(arg1: T, arg2: U) {
+>Baz : <T extends { b: number; }, U extends { a: boolean; b: string; }>(arg1: T, arg2: U) => void
+>T : T
+>b : number
+>U : U
+>a : boolean
+>b : string
+>arg1 : T
+>T : T
+>arg2 : U
+>U : U
+
+    let a0 = <OverloadComponent {...arg1} a="hello" ignore-prop />;
+>a0 : JSX.Element
+><OverloadComponent {...arg1} a="hello" ignore-prop /> : JSX.Element
+>OverloadComponent : { <U>(): JSX.Element; <U>(attr: { b: U; a?: string; "ignore-prop": boolean; }): JSX.Element; <T, U>(attr: { b: U; a: T; }): JSX.Element; }
+>arg1 : T
+>a : string
+>ignore-prop : true
+
+    let a1 = <OverloadComponent {...arg2} ignore-pro="hello world" />;
+>a1 : JSX.Element
+><OverloadComponent {...arg2} ignore-pro="hello world" /> : JSX.Element
+>OverloadComponent : { <U>(): JSX.Element; <U>(attr: { b: U; a?: string; "ignore-prop": boolean; }): JSX.Element; <T, U>(attr: { b: U; a: T; }): JSX.Element; }
+>arg2 : U
+>ignore-pro : string
+
+    let a2 = <OverloadComponent {...arg2} />;
+>a2 : JSX.Element
+><OverloadComponent {...arg2} /> : JSX.Element
+>OverloadComponent : { <U>(): JSX.Element; <U>(attr: { b: U; a?: string; "ignore-prop": boolean; }): JSX.Element; <T, U>(attr: { b: U; a: T; }): JSX.Element; }
+>arg2 : U
+
+    let a3 = <OverloadComponent {...arg1} ignore-prop />;
+>a3 : JSX.Element
+><OverloadComponent {...arg1} ignore-prop /> : JSX.Element
+>OverloadComponent : { <U>(): JSX.Element; <U>(attr: { b: U; a?: string; "ignore-prop": boolean; }): JSX.Element; <T, U>(attr: { b: U; a: T; }): JSX.Element; }
+>arg1 : T
+>ignore-prop : true
+
+    let a4 = <OverloadComponent />;
+>a4 : JSX.Element
+><OverloadComponent /> : JSX.Element
+>OverloadComponent : { <U>(): JSX.Element; <U>(attr: { b: U; a?: string; "ignore-prop": boolean; }): JSX.Element; <T, U>(attr: { b: U; a: T; }): JSX.Element; }
+
+    let a5 = <OverloadComponent {...arg2} ignore-prop="hello" {...arg1} />;
+>a5 : JSX.Element
+><OverloadComponent {...arg2} ignore-prop="hello" {...arg1} /> : JSX.Element
+>OverloadComponent : { <U>(): JSX.Element; <U>(attr: { b: U; a?: string; "ignore-prop": boolean; }): JSX.Element; <T, U>(attr: { b: U; a: T; }): JSX.Element; }
+>arg2 : U
+>ignore-prop : string
+>arg1 : T
+
+    let a6 = <OverloadComponent {...arg2} ignore-prop {...arg1} />;
+>a6 : JSX.Element
+><OverloadComponent {...arg2} ignore-prop {...arg1} /> : JSX.Element
+>OverloadComponent : { <U>(): JSX.Element; <U>(attr: { b: U; a?: string; "ignore-prop": boolean; }): JSX.Element; <T, U>(attr: { b: U; a: T; }): JSX.Element; }
+>arg2 : U
+>ignore-prop : true
+>arg1 : T
+}
+
+declare function Link<U>(l: {func: (arg: U)=>void}): JSX.Element;
+>Link : { <U>(l: { func: (arg: U) => void; }): JSX.Element; <U>(l: { func: (arg1: U, arg2: string) => void; }): JSX.Element; }
+>U : U
+>l : { func: (arg: U) => void; }
+>func : (arg: U) => void
+>arg : U
+>U : U
+>JSX : any
+>Element : JSX.Element
+
+declare function Link<U>(l: {func: (arg1:U, arg2: string)=>void}): JSX.Element;
+>Link : { <U>(l: { func: (arg: U) => void; }): JSX.Element; <U>(l: { func: (arg1: U, arg2: string) => void; }): JSX.Element; }
+>U : U
+>l : { func: (arg1: U, arg2: string) => void; }
+>func : (arg1: U, arg2: string) => void
+>arg1 : U
+>U : U
+>arg2 : string
+>JSX : any
+>Element : JSX.Element
+
+function createLink(func: (a: number)=>void) {
+>createLink : (func: (a: number) => void) => void
+>func : (a: number) => void
+>a : number
+
+    let o = <Link func={func} />
+>o : JSX.Element
+><Link func={func} /> : JSX.Element
+>Link : { <U>(l: { func: (arg: U) => void; }): JSX.Element; <U>(l: { func: (arg1: U, arg2: string) => void; }): JSX.Element; }
+>func : (a: number) => void
+>func : (a: number) => void
+
+    let o1 = <Link func={(a:number, b:string)=>{}} />;
+>o1 : JSX.Element
+><Link func={(a:number, b:string)=>{}} /> : JSX.Element
+>Link : { <U>(l: { func: (arg: U) => void; }): JSX.Element; <U>(l: { func: (arg1: U, arg2: string) => void; }): JSX.Element; }
+>func : (a: number, b: string) => void
+>(a:number, b:string)=>{} : (a: number, b: string) => void
+>a : number
+>b : string
+}
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt
new file mode 100644
index 0000000000000..4c1e768d04d95
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt
@@ -0,0 +1,25 @@
+tests/cases/conformance/jsx/file.tsx(10,33): error TS2322: Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes & { b: {}; a: number; }'.
+  Type '{ a: number; }' is not assignable to type '{ b: {}; a: number; }'.
+    Property 'b' is missing in type '{ a: number; }'.
+tests/cases/conformance/jsx/file.tsx(11,33): error TS2698: Spread types may only be created from object types.
+
+
+==== tests/cases/conformance/jsx/file.tsx (2 errors) ====
+    
+    import React = require('react')
+    
+    declare function OverloadComponent<U>(): JSX.Element;
+    declare function OverloadComponent<U>(attr: {b: U, a: string, "ignore-prop": boolean}): JSX.Element;
+    declare function OverloadComponent<T, U>(attr: {b: U, a: T}): JSX.Element;
+    
+    // Error
+    function Baz<T extends {b: number}, U extends {a: boolean, b:string}>(arg1: T, arg2: U) {
+        let a0 = <OverloadComponent a={arg1.b}/>
+                                    ~~~~~~~~~~
+!!! error TS2322: Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes & { b: {}; a: number; }'.
+!!! error TS2322:   Type '{ a: number; }' is not assignable to type '{ b: {}; a: number; }'.
+!!! error TS2322:     Property 'b' is missing in type '{ a: number; }'.
+        let a2 = <OverloadComponent {...arg1} ignore-prop />  // missing a
+                                    ~~~~~~~~~
+!!! error TS2698: Spread types may only be created from object types.
+    }
\ No newline at end of file
diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.js b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.js
new file mode 100644
index 0000000000000..63d24e3ab6af7
--- /dev/null
+++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments4.js
@@ -0,0 +1,23 @@
+//// [file.tsx]
+
+import React = require('react')
+
+declare function OverloadComponent<U>(): JSX.Element;
+declare function OverloadComponent<U>(attr: {b: U, a: string, "ignore-prop": boolean}): JSX.Element;
+declare function OverloadComponent<T, U>(attr: {b: U, a: T}): JSX.Element;
+
+// Error
+function Baz<T extends {b: number}, U extends {a: boolean, b:string}>(arg1: T, arg2: U) {
+    let a0 = <OverloadComponent a={arg1.b}/>
+    let a2 = <OverloadComponent {...arg1} ignore-prop />  // missing a
+}
+
+//// [file.jsx]
+define(["require", "exports", "react"], function (require, exports, React) {
+    "use strict";
+    // Error
+    function Baz(arg1, arg2) {
+        var a0 = <OverloadComponent a={arg1.b}/>;
+        var a2 = <OverloadComponent {...arg1} ignore-prop/>; // missing a
+    }
+});
diff --git a/tests/baselines/reference/tsxTypeErrors.symbols b/tests/baselines/reference/tsxTypeErrors.symbols
index 062442cda1604..52a2d6a757444 100644
--- a/tests/baselines/reference/tsxTypeErrors.symbols
+++ b/tests/baselines/reference/tsxTypeErrors.symbols
@@ -4,13 +4,13 @@
 var a1 = <div id="foo" />;
 >a1 : Symbol(a1, Decl(tsxTypeErrors.tsx, 2, 3))
 >div : Symbol(unknown)
->id : Symbol(unknown)
+>id : Symbol(id, Decl(tsxTypeErrors.tsx, 2, 13))
 
 // A built-in element with a mistyped property (error)
 var a2 = <img srce="foo.jpg" />
 >a2 : Symbol(a2, Decl(tsxTypeErrors.tsx, 5, 3))
 >img : Symbol(unknown)
->srce : Symbol(unknown)
+>srce : Symbol(srce, Decl(tsxTypeErrors.tsx, 5, 13))
 
 // A built-in element with a badly-typed attribute value (error)
 var thing = { oops: 100 };
@@ -20,14 +20,14 @@ var thing = { oops: 100 };
 var a3 = <div id={thing} />
 >a3 : Symbol(a3, Decl(tsxTypeErrors.tsx, 9, 3))
 >div : Symbol(unknown)
->id : Symbol(unknown)
+>id : Symbol(id, Decl(tsxTypeErrors.tsx, 9, 13))
 >thing : Symbol(thing, Decl(tsxTypeErrors.tsx, 8, 3))
 
 // Mistyped html name (error)
 var e1 = <imag src="bar.jpg" />
 >e1 : Symbol(e1, Decl(tsxTypeErrors.tsx, 12, 3))
 >imag : Symbol(unknown)
->src : Symbol(unknown)
+>src : Symbol(src, Decl(tsxTypeErrors.tsx, 12, 14))
 
 // A custom type
 class MyClass {
@@ -54,7 +54,7 @@ class MyClass {
 var b1 = <MyClass reqd={true} />; 
 >b1 : Symbol(b1, Decl(tsxTypeErrors.tsx, 25, 3))
 >MyClass : Symbol(MyClass, Decl(tsxTypeErrors.tsx, 12, 31))
->reqd : Symbol(unknown)
+>reqd : Symbol(reqd, Decl(tsxTypeErrors.tsx, 25, 17))
 
 // Mistyped attribute member
 // sample.tsx(23,22): error TS2322: Type '{ x: number; y: string; }' is not assignable to type '{ x: number; y: number; }'.
@@ -63,7 +63,7 @@ var b1 = <MyClass reqd={true} />;
 var b2 = <MyClass pt={{x: 4, y: 'oops'}} />;
 >b2 : Symbol(b2, Decl(tsxTypeErrors.tsx, 31, 3))
 >MyClass : Symbol(MyClass, Decl(tsxTypeErrors.tsx, 12, 31))
->pt : Symbol(unknown)
+>pt : Symbol(pt, Decl(tsxTypeErrors.tsx, 31, 17))
 >x : Symbol(x, Decl(tsxTypeErrors.tsx, 31, 23))
 >y : Symbol(y, Decl(tsxTypeErrors.tsx, 31, 28))
 
diff --git a/tests/baselines/reference/tsxTypeErrors.types b/tests/baselines/reference/tsxTypeErrors.types
index d64781479fa27..f20c16dca163a 100644
--- a/tests/baselines/reference/tsxTypeErrors.types
+++ b/tests/baselines/reference/tsxTypeErrors.types
@@ -5,14 +5,14 @@ var a1 = <div id="foo" />;
 >a1 : any
 ><div id="foo" /> : any
 >div : any
->id : any
+>id : string
 
 // A built-in element with a mistyped property (error)
 var a2 = <img srce="foo.jpg" />
 >a2 : any
 ><img srce="foo.jpg" /> : any
 >img : any
->srce : any
+>srce : string
 
 // A built-in element with a badly-typed attribute value (error)
 var thing = { oops: 100 };
@@ -25,7 +25,7 @@ var a3 = <div id={thing} />
 >a3 : any
 ><div id={thing} /> : any
 >div : any
->id : any
+>id : { oops: number; }
 >thing : { oops: number; }
 
 // Mistyped html name (error)
@@ -33,7 +33,7 @@ var e1 = <imag src="bar.jpg" />
 >e1 : any
 ><imag src="bar.jpg" /> : any
 >imag : any
->src : any
+>src : string
 
 // A custom type
 class MyClass {
@@ -61,7 +61,7 @@ var b1 = <MyClass reqd={true} />;
 >b1 : any
 ><MyClass reqd={true} /> : any
 >MyClass : typeof MyClass
->reqd : any
+>reqd : boolean
 >true : true
 
 // Mistyped attribute member
@@ -72,7 +72,7 @@ var b2 = <MyClass pt={{x: 4, y: 'oops'}} />;
 >b2 : any
 ><MyClass pt={{x: 4, y: 'oops'}} /> : any
 >MyClass : typeof MyClass
->pt : any
+>pt : { x: number; y: string; }
 >{x: 4, y: 'oops'} : { x: number; y: string; }
 >x : number
 >4 : 4
diff --git a/tests/baselines/reference/tsxUnionTypeComponent1.symbols b/tests/baselines/reference/tsxUnionTypeComponent1.symbols
index 73f7180f3b8cd..be4bc204da3ea 100644
--- a/tests/baselines/reference/tsxUnionTypeComponent1.symbols
+++ b/tests/baselines/reference/tsxUnionTypeComponent1.symbols
@@ -9,16 +9,16 @@ interface ComponentProps {
     AnyComponent: React.StatelessComponent<any> | React.ComponentClass<any>;
 >AnyComponent : Symbol(ComponentProps.AnyComponent, Decl(file.tsx, 3, 26))
 >React : Symbol(React, Decl(file.tsx, 0, 0))
->StatelessComponent : Symbol(React.StatelessComponent, Decl(react.d.ts, 139, 5))
+>StatelessComponent : Symbol(React.StatelessComponent, Decl(react.d.ts, 197, 40))
 >React : Symbol(React, Decl(file.tsx, 0, 0))
->ComponentClass : Symbol(React.ComponentClass, Decl(react.d.ts, 150, 5))
+>ComponentClass : Symbol(React.ComponentClass, Decl(react.d.ts, 204, 5))
 }
 
 class MyComponent extends React.Component<ComponentProps, {}> {
 >MyComponent : Symbol(MyComponent, Decl(file.tsx, 5, 1))
->React.Component : Symbol(React.Component, Decl(react.d.ts, 114, 55))
+>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
 >React : Symbol(React, Decl(file.tsx, 0, 0))
->Component : Symbol(React.Component, Decl(react.d.ts, 114, 55))
+>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
 >ComponentProps : Symbol(ComponentProps, Decl(file.tsx, 1, 32))
 
     render() {
@@ -26,9 +26,9 @@ class MyComponent extends React.Component<ComponentProps, {}> {
 
         const { AnyComponent } = this.props;
 >AnyComponent : Symbol(AnyComponent, Decl(file.tsx, 9, 15))
->this.props : Symbol(React.Component.props, Decl(react.d.ts, 122, 30))
+>this.props : Symbol(React.Component.props, Decl(react.d.ts, 166, 37))
 >this : Symbol(MyComponent, Decl(file.tsx, 5, 1))
->props : Symbol(React.Component.props, Decl(react.d.ts, 122, 30))
+>props : Symbol(React.Component.props, Decl(react.d.ts, 166, 37))
 
         return (<AnyComponent />);
 >AnyComponent : Symbol(AnyComponent, Decl(file.tsx, 9, 15))
@@ -38,21 +38,21 @@ class MyComponent extends React.Component<ComponentProps, {}> {
 // Stateless Component As Props
 <MyComponent AnyComponent={() => <button>test</button>}/>
 >MyComponent : Symbol(MyComponent, Decl(file.tsx, 5, 1))
->AnyComponent : Symbol(ComponentProps.AnyComponent, Decl(file.tsx, 3, 26))
->button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 913, 43))
->button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 913, 43))
+>AnyComponent : Symbol(AnyComponent, Decl(file.tsx, 15, 12))
+>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2383, 43))
+>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2383, 43))
 
 // Component Class as Props
 class MyButtonComponent extends React.Component<{},{}> {
 >MyButtonComponent : Symbol(MyButtonComponent, Decl(file.tsx, 15, 57))
->React.Component : Symbol(React.Component, Decl(react.d.ts, 114, 55))
+>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
 >React : Symbol(React, Decl(file.tsx, 0, 0))
->Component : Symbol(React.Component, Decl(react.d.ts, 114, 55))
+>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
 }
 
 <MyComponent AnyComponent={MyButtonComponent} />
 >MyComponent : Symbol(MyComponent, Decl(file.tsx, 5, 1))
->AnyComponent : Symbol(ComponentProps.AnyComponent, Decl(file.tsx, 3, 26))
+>AnyComponent : Symbol(AnyComponent, Decl(file.tsx, 21, 12))
 >MyButtonComponent : Symbol(MyButtonComponent, Decl(file.tsx, 15, 57))
 
 
diff --git a/tests/baselines/reference/tsxUnionTypeComponent1.types b/tests/baselines/reference/tsxUnionTypeComponent1.types
index ce6e3bbeecc6c..c3f4c70a30715 100644
--- a/tests/baselines/reference/tsxUnionTypeComponent1.types
+++ b/tests/baselines/reference/tsxUnionTypeComponent1.types
@@ -26,9 +26,9 @@ class MyComponent extends React.Component<ComponentProps, {}> {
 
         const { AnyComponent } = this.props;
 >AnyComponent : React.StatelessComponent<any> | React.ComponentClass<any>
->this.props : ComponentProps
+>this.props : ComponentProps & { children?: React.ReactNode; }
 >this : this
->props : ComponentProps
+>props : ComponentProps & { children?: React.ReactNode; }
 
         return (<AnyComponent />);
 >(<AnyComponent />) : JSX.Element
@@ -41,7 +41,7 @@ class MyComponent extends React.Component<ComponentProps, {}> {
 <MyComponent AnyComponent={() => <button>test</button>}/>
 ><MyComponent AnyComponent={() => <button>test</button>}/> : JSX.Element
 >MyComponent : typeof MyComponent
->AnyComponent : any
+>AnyComponent : () => JSX.Element
 >() => <button>test</button> : () => JSX.Element
 ><button>test</button> : JSX.Element
 >button : any
@@ -58,7 +58,7 @@ class MyButtonComponent extends React.Component<{},{}> {
 <MyComponent AnyComponent={MyButtonComponent} />
 ><MyComponent AnyComponent={MyButtonComponent} /> : JSX.Element
 >MyComponent : typeof MyComponent
->AnyComponent : any
+>AnyComponent : typeof MyButtonComponent
 >MyButtonComponent : typeof MyButtonComponent
 
 
diff --git a/tests/baselines/reference/unusedLocalProperty.js b/tests/baselines/reference/unusedLocalProperty.js
new file mode 100644
index 0000000000000..a124b752125d7
--- /dev/null
+++ b/tests/baselines/reference/unusedLocalProperty.js
@@ -0,0 +1,25 @@
+//// [unusedLocalProperty.ts]
+declare var console: { log(msg: any): void; }
+class Animal {
+    constructor(private species: string) {
+    }
+
+    printSpecies() {
+        let { species } = this;
+        console.log(species);
+    }
+}
+
+
+
+//// [unusedLocalProperty.js]
+var Animal = (function () {
+    function Animal(species) {
+        this.species = species;
+    }
+    Animal.prototype.printSpecies = function () {
+        var species = this.species;
+        console.log(species);
+    };
+    return Animal;
+}());
diff --git a/tests/baselines/reference/unusedLocalProperty.symbols b/tests/baselines/reference/unusedLocalProperty.symbols
new file mode 100644
index 0000000000000..6a3343bd5456e
--- /dev/null
+++ b/tests/baselines/reference/unusedLocalProperty.symbols
@@ -0,0 +1,29 @@
+=== tests/cases/compiler/unusedLocalProperty.ts ===
+declare var console: { log(msg: any): void; }
+>console : Symbol(console, Decl(unusedLocalProperty.ts, 0, 11))
+>log : Symbol(log, Decl(unusedLocalProperty.ts, 0, 22))
+>msg : Symbol(msg, Decl(unusedLocalProperty.ts, 0, 27))
+
+class Animal {
+>Animal : Symbol(Animal, Decl(unusedLocalProperty.ts, 0, 45))
+
+    constructor(private species: string) {
+>species : Symbol(Animal.species, Decl(unusedLocalProperty.ts, 2, 16))
+    }
+
+    printSpecies() {
+>printSpecies : Symbol(Animal.printSpecies, Decl(unusedLocalProperty.ts, 3, 5))
+
+        let { species } = this;
+>species : Symbol(species, Decl(unusedLocalProperty.ts, 6, 13))
+>this : Symbol(Animal, Decl(unusedLocalProperty.ts, 0, 45))
+
+        console.log(species);
+>console.log : Symbol(log, Decl(unusedLocalProperty.ts, 0, 22))
+>console : Symbol(console, Decl(unusedLocalProperty.ts, 0, 11))
+>log : Symbol(log, Decl(unusedLocalProperty.ts, 0, 22))
+>species : Symbol(species, Decl(unusedLocalProperty.ts, 6, 13))
+    }
+}
+
+
diff --git a/tests/baselines/reference/unusedLocalProperty.types b/tests/baselines/reference/unusedLocalProperty.types
new file mode 100644
index 0000000000000..3cb8747957db5
--- /dev/null
+++ b/tests/baselines/reference/unusedLocalProperty.types
@@ -0,0 +1,30 @@
+=== tests/cases/compiler/unusedLocalProperty.ts ===
+declare var console: { log(msg: any): void; }
+>console : { log(msg: any): void; }
+>log : (msg: any) => void
+>msg : any
+
+class Animal {
+>Animal : Animal
+
+    constructor(private species: string) {
+>species : string
+    }
+
+    printSpecies() {
+>printSpecies : () => void
+
+        let { species } = this;
+>species : string
+>this : this
+
+        console.log(species);
+>console.log(species) : void
+>console.log : (msg: any) => void
+>console : { log(msg: any): void; }
+>log : (msg: any) => void
+>species : string
+    }
+}
+
+
diff --git a/tests/cases/compiler/unusedLocalProperty.ts b/tests/cases/compiler/unusedLocalProperty.ts
new file mode 100644
index 0000000000000..fdd33116135fc
--- /dev/null
+++ b/tests/cases/compiler/unusedLocalProperty.ts
@@ -0,0 +1,12 @@
+//@noUnusedLocals:true
+declare var console: { log(msg: any): void; }
+class Animal {
+    constructor(private species: string) {
+    }
+
+    printSpecies() {
+        let { species } = this;
+        console.log(species);
+    }
+}
+
diff --git a/tests/cases/conformance/expressions/functionCalls/callWithSpread.ts b/tests/cases/conformance/expressions/functionCalls/callWithSpread.ts
index 245028db3d425..b1e2ee757848c 100644
--- a/tests/cases/conformance/expressions/functionCalls/callWithSpread.ts
+++ b/tests/cases/conformance/expressions/functionCalls/callWithSpread.ts
@@ -1,5 +1,5 @@
 interface X {
-    foo(x: number, y: number, ...z: string[]);
+    foo(x: number, y: number, ...z: string[]): X;
 }
 
 function foo(x: number, y: number, ...z: string[]) {
@@ -18,10 +18,18 @@ obj.foo(1, 2, "abc");
 obj.foo(1, 2, ...a);
 obj.foo(1, 2, ...a, "abc");
 
+obj.foo(1, 2, ...a).foo(1, 2, "abc");
+obj.foo(1, 2, ...a).foo(1, 2, ...a);
+obj.foo(1, 2, ...a).foo(1, 2, ...a, "abc");
+
 (obj.foo)(1, 2, "abc");
 (obj.foo)(1, 2, ...a);
 (obj.foo)(1, 2, ...a, "abc");
 
+((obj.foo)(1, 2, ...a).foo)(1, 2, "abc");
+((obj.foo)(1, 2, ...a).foo)(1, 2, ...a);
+((obj.foo)(1, 2, ...a).foo)(1, 2, ...a, "abc");
+
 xa[1].foo(1, 2, "abc");
 xa[1].foo(1, 2, ...a);
 xa[1].foo(1, 2, ...a, "abc");
diff --git a/tests/cases/conformance/jsx/tsxAttributeResolution3.tsx b/tests/cases/conformance/jsx/tsxAttributeResolution3.tsx
index dc0c2fed8d638..9a9e0d8245d28 100644
--- a/tests/cases/conformance/jsx/tsxAttributeResolution3.tsx
+++ b/tests/cases/conformance/jsx/tsxAttributeResolution3.tsx
@@ -36,6 +36,6 @@ var obj5 = { x: 32, y: 32 };
 var obj6 = { x: 'ok', y: 32, extra: 100 };
 <test1 {...obj6} />
 
-// Error
+// OK (spread override)
 var obj7 = { x: 'foo' };
 <test1 x={32} {...obj7} />
diff --git a/tests/cases/conformance/jsx/tsxDefaultAttributesResolution1.tsx b/tests/cases/conformance/jsx/tsxDefaultAttributesResolution1.tsx
new file mode 100644
index 0000000000000..03314b400ee44
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxDefaultAttributesResolution1.tsx
@@ -0,0 +1,18 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react');
+
+interface Prop {
+    x: boolean;
+}
+class Poisoned extends React.Component<Prop, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+// OK
+let p = <Poisoned x/>;
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxDefaultAttributesResolution2.tsx b/tests/cases/conformance/jsx/tsxDefaultAttributesResolution2.tsx
new file mode 100644
index 0000000000000..b00655b5a5717
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxDefaultAttributesResolution2.tsx
@@ -0,0 +1,18 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react');
+
+interface Prop {
+    x: true;
+}
+class Poisoned extends React.Component<Prop, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+// OK
+let p = <Poisoned x/>;
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxDefaultAttributesResolution3.tsx b/tests/cases/conformance/jsx/tsxDefaultAttributesResolution3.tsx
new file mode 100644
index 0000000000000..303e6ef891d68
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxDefaultAttributesResolution3.tsx
@@ -0,0 +1,18 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react');
+
+interface Prop {
+    x: false;
+}
+class Poisoned extends React.Component<Prop, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+// Error
+let p = <Poisoned x/>;
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxElementResolution12.tsx b/tests/cases/conformance/jsx/tsxElementResolution12.tsx
index a5d8f2d812b4b..a4b47336ef891 100644
--- a/tests/cases/conformance/jsx/tsxElementResolution12.tsx
+++ b/tests/cases/conformance/jsx/tsxElementResolution12.tsx
@@ -15,7 +15,7 @@ var Obj1: Obj1type;
 interface Obj2type {
 	new(n: string): { q?: number; pr: any };
 }
-var obj2: Obj2type;
+var Obj2: Obj2type;
 <Obj2 x={10} />; // OK
 
 interface Obj3type {
diff --git a/tests/cases/conformance/jsx/tsxEmit2.tsx b/tests/cases/conformance/jsx/tsxEmit2.tsx
index 24f51a4583d86..8d90fccdcd109 100644
--- a/tests/cases/conformance/jsx/tsxEmit2.tsx
+++ b/tests/cases/conformance/jsx/tsxEmit2.tsx
@@ -7,7 +7,7 @@ declare module JSX {
 	}
 }
 
-var p1, p2, p3;
+var p1: any, p2: any, p3: any;
 var spreads1 = <div {...p1}>{p2}</div>;
 var spreads2 = <div {...p1}>{p2}</div>;
 var spreads3 = <div x={p3} {...p1}>{p2}</div>;
diff --git a/tests/cases/conformance/jsx/tsxReactEmit2.tsx b/tests/cases/conformance/jsx/tsxReactEmit2.tsx
index 96ab8c6046b27..762b36b843238 100644
--- a/tests/cases/conformance/jsx/tsxReactEmit2.tsx
+++ b/tests/cases/conformance/jsx/tsxReactEmit2.tsx
@@ -8,7 +8,7 @@ declare module JSX {
 }
 declare var React: any;
 
-var p1, p2, p3;
+var p1: any, p2: any, p3: any;
 var spreads1 = <div {...p1}>{p2}</div>;
 var spreads2 = <div {...p1}>{p2}</div>;
 var spreads3 = <div x={p3} {...p1}>{p2}</div>;
diff --git a/tests/cases/conformance/jsx/tsxReactEmit4.tsx b/tests/cases/conformance/jsx/tsxReactEmit4.tsx
index a032a5a3985d1..3fbff0975a5e7 100644
--- a/tests/cases/conformance/jsx/tsxReactEmit4.tsx
+++ b/tests/cases/conformance/jsx/tsxReactEmit4.tsx
@@ -8,7 +8,7 @@ declare module JSX {
 }
 declare var React: any;
 
-var p;
+var p: any;
 var openClosed1 = <div>
 
    {blah}
diff --git a/tests/cases/conformance/jsx/tsxReactEmit5.tsx b/tests/cases/conformance/jsx/tsxReactEmit5.tsx
index c961a23ecfc77..f8787eb4aa35d 100644
--- a/tests/cases/conformance/jsx/tsxReactEmit5.tsx
+++ b/tests/cases/conformance/jsx/tsxReactEmit5.tsx
@@ -16,5 +16,5 @@ export var React;
 import {React} from "./test";
 // Should emit test_1.React.createElement
 //  and React.__spread
-var foo;
+var foo: any;
 var spread1 = <div x='' {...foo} y='' />;
diff --git a/tests/cases/conformance/jsx/tsxReactEmit6.tsx b/tests/cases/conformance/jsx/tsxReactEmit6.tsx
index 0e8c772a3f1bc..abc41a690d4b8 100644
--- a/tests/cases/conformance/jsx/tsxReactEmit6.tsx
+++ b/tests/cases/conformance/jsx/tsxReactEmit6.tsx
@@ -17,7 +17,7 @@ namespace M {
 namespace M {
 	// Should emit M.React.createElement
 	//  and M.React.__spread
-	var foo;
+	var foo: any;
 	var spread1 = <div x='' {...foo} y='' />;
 
 	// Quotes
diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution1.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution1.tsx
new file mode 100644
index 0000000000000..6d5225df2d902
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution1.tsx
@@ -0,0 +1,18 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react');
+
+class Poisoned extends React.Component<{}, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+const obj: Object = {};
+
+// OK
+let p = <Poisoned {...obj} />;
+let y = <Poisoned />;
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution10.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution10.tsx
new file mode 100644
index 0000000000000..6410f075ae962
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution10.tsx
@@ -0,0 +1,27 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react');
+
+interface OptionProp {
+    x?: 2
+}
+
+class Opt extends React.Component<OptionProp, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+const obj: OptionProp = {};
+const obj1: OptionProp = {
+    x: 2
+}
+
+// Error
+let y = <Opt {...obj} x={3}/>;
+let y1 = <Opt {...obj1} x="Hi"/>;
+let y2 = <Opt {...obj1} x={3}/>;
+let y3 = <Opt x />;
diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution11.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution11.tsx
new file mode 100644
index 0000000000000..c80086234411c
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution11.tsx
@@ -0,0 +1,36 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react');
+
+const obj = {};
+const obj1: { x: 2 } = {
+    x: 2
+}
+const obj3: {y: true, overwrite: string } = {
+    y: true,
+    overwrite: "hi"
+}
+
+interface Prop {
+    x: 2
+    y: true
+    overwrite: string
+}
+
+class OverWriteAttr extends React.Component<Prop, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+let anyobj: any;
+// OK
+let x = <OverWriteAttr {...obj} y overwrite="hi" {...obj1} />
+let x1 = <OverWriteAttr {...obj1} {...obj3} />
+let x2 = <OverWriteAttr x={3} overwrite="hi" {...obj1} {...{y: true}} />
+let x3 = <OverWriteAttr overwrite="hi" {...obj1} x={3} {...{y: true, x: 2, overwrite:"world"}} />
+let x4 = <OverWriteAttr {...{x: 2}} {...{overwrite: "world"}} {...{y: true}} />
+let x5 = <OverWriteAttr {...anyobj} />
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution12.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution12.tsx
new file mode 100644
index 0000000000000..b5150bd27ff1f
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution12.tsx
@@ -0,0 +1,34 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react');
+
+const obj = {};
+const obj1: {x: 2} = {
+    x: 2
+}
+const obj3: {y: false, overwrite: string} = {
+    y: false,
+    overwrite: "hi"
+}
+
+interface Prop {
+    x: 2
+    y: false
+    overwrite: string
+}
+
+class OverWriteAttr extends React.Component<Prop, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+let anyobj: any;
+
+// Error
+let x = <OverWriteAttr {...obj} y overwrite="hi" {...obj1} />
+let x1 = <OverWriteAttr overwrite="hi" {...obj1} x={3} {...{y: true}} />
+let x2 = <OverWriteAttr {...anyobj} x={3} />
diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution2.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution2.tsx
new file mode 100644
index 0000000000000..9790e39fc07b1
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution2.tsx
@@ -0,0 +1,24 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react');
+
+interface PoisonedProp {
+    x: string;
+    y: "2";
+}
+
+class Poisoned extends React.Component<PoisonedProp, {}> {
+    render() {
+        return <div>Hello</div>;
+    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+}
+
+const obj = {};
+
+// Error
+let p = <Poisoned {...obj} />;
+let y = <Poisoned />;
+let z = <Poisoned x y/>;
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution3.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution3.tsx
new file mode 100644
index 0000000000000..6e84febe3e9f8
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution3.tsx
@@ -0,0 +1,26 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react');
+
+interface PoisonedProp {
+    x: string;
+    y: number;
+}
+
+class Poisoned extends React.Component<PoisonedProp, {}> {
+    render() {
+        return <div>Hello</div>;
+    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+}
+
+const obj = {
+    x: "hello world",
+    y: 2
+};
+
+// OK
+let p = <Poisoned {...obj} />;
+let y = <Poisoned x="hi" y={2} />;
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution4.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution4.tsx
new file mode 100644
index 0000000000000..9e5e4f31e118c
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution4.tsx
@@ -0,0 +1,25 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react');
+
+interface PoisonedProp {
+    x: string;
+    y: 2;
+}
+
+class Poisoned extends React.Component<PoisonedProp, {}> {
+    render() {
+        return <div>Hello</div>;
+    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+}
+
+const obj: PoisonedProp = {
+    x: "hello world",
+    y: 2
+};
+
+// OK
+let p = <Poisoned {...obj} />;
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution5.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution5.tsx
new file mode 100644
index 0000000000000..9f998cf0ceb4a
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution5.tsx
@@ -0,0 +1,25 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react');
+
+interface PoisonedProp {
+    x: string;
+    y: 2;
+}
+
+class Poisoned extends React.Component<PoisonedProp, {}> {
+    render() {
+        return <div>Hello</div>;
+    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+}
+
+let obj = {
+    x: "hello world",
+    y: 2
+};
+
+// Error as "obj" has type { x: string; y: number }
+let p = <Poisoned {...obj} />;
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution6.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution6.tsx
new file mode 100644
index 0000000000000..35a190e10cc08
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution6.tsx
@@ -0,0 +1,22 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react');
+
+type TextProps = { editable: false }
+               | { editable: true, onEdit: (newText: string) => void };
+
+class TextComponent extends React.Component<TextProps, {}> {
+    render() {
+        return <span>Some Text..</span>;
+    }
+}
+
+// Error
+let x = <TextComponent editable={true} />
+
+const textProps: TextProps = {
+    editable: false
+};
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution7.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution7.tsx
new file mode 100644
index 0000000000000..55e3222c0221a
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution7.tsx
@@ -0,0 +1,29 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react');
+
+type TextProps = { editable: false }
+               | { editable: true, onEdit: (newText: string) => void };
+
+class TextComponent extends React.Component<TextProps, {}> {
+    render() {
+        return <span>Some Text..</span>;
+    }
+}
+
+// OK
+const textPropsFalse: TextProps = {
+    editable: false
+};
+
+let y1 = <TextComponent {...textPropsFalse} />
+
+const textPropsTrue: TextProps = {
+    editable: true,
+    onEdit: () => {}
+};
+
+let y2 = <TextComponent {...textPropsTrue} />
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution8.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution8.tsx
new file mode 100644
index 0000000000000..937678605d679
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution8.tsx
@@ -0,0 +1,31 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react');
+
+const obj = {};
+const obj1 = {
+    x: 2
+}
+const obj3 = {
+    y: true,
+    overwrite: "hi"
+}
+
+interface Prop {
+    x: number
+    y: boolean
+    overwrite: string
+}
+
+class OverWriteAttr extends React.Component<Prop, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+// OK
+let x = <OverWriteAttr {...obj} y overwrite="hi" {...obj1} />
+let x1 = <OverWriteAttr {...obj1} {...obj3}  />
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution9.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution9.tsx
new file mode 100644
index 0000000000000..9f2a63a56b6e7
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution9.tsx
@@ -0,0 +1,29 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react');
+
+interface OptionProp {
+    x?: 2
+    y?: boolean
+}
+
+class Opt extends React.Component<OptionProp, {}> {
+    render() {
+        return <div>Hello</div>;
+    }
+}
+
+const obj: OptionProp = {};
+const obj1: OptionProp = {
+    x: 2
+}
+
+// OK
+let p = <Opt />;
+let y = <Opt {...obj} />;
+let y1 = <Opt {...obj1} />;
+let y2 = <Opt {...obj1} y/>;
+let y3 = <Opt x={2} />;
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload1.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload1.tsx
new file mode 100644
index 0000000000000..ea950d8b6d488
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload1.tsx
@@ -0,0 +1,44 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @module: amd
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react')
+
+declare function OneThing(k: {yxx: string}): JSX.Element;
+declare function OneThing(l: {yy: number, yy1: string}): JSX.Element;
+declare function OneThing(l: {yy: number, yy1: string, yy2: boolean}): JSX.Element;
+declare function OneThing(l1: {data: string, "data-prop": boolean}): JSX.Element;
+
+// OK
+const c1 = <OneThing yxx='ok' />
+const c2 = <OneThing yy={100}  yy1="hello"/>
+const c3 = <OneThing yxx="hello" ignore-prop />
+const c4 = <OneThing data="hello" data-prop />
+
+declare function TestingOneThing({y1: string}): JSX.Element;
+declare function TestingOneThing(j: {"extra-data": string, yy?: string}): JSX.Element;
+declare function TestingOneThing(n: {yy: number, direction?: number}): JSX.Element;
+declare function TestingOneThing(n: {yy: string, name: string}): JSX.Element;
+
+// OK
+const d1 = <TestingOneThing y1 extra-data />;
+const d2 = <TestingOneThing extra-data="hello" />;
+const d3 = <TestingOneThing extra-data="hello" yy="hihi" />;
+const d4 = <TestingOneThing extra-data="hello" yy={9} direction={10} />;
+const d5 = <TestingOneThing extra-data="hello" yy="hello" name="Bob" />;
+
+
+declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element;
+declare function TestingOptional(a: {y1: boolean, y2?: number, y3: boolean}): JSX.Element;
+
+// OK
+const e1 = <TestingOptional />
+const e2 = <TestingOptional extra-prop/>
+const e3 = <TestingOptional y1="hello"/>
+const e4 = <TestingOptional y1="hello" y2={1000} />
+const e5 = <TestingOptional y1 y3/>
+const e6 = <TestingOptional y1 y3 y2={10} />
+
+
diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload2.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload2.tsx
new file mode 100644
index 0000000000000..fe2a3eb747772
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload2.tsx
@@ -0,0 +1,37 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @module: amd
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react')
+declare function OneThing(): JSX.Element;
+declare function OneThing(l: {yy: number, yy1: string}): JSX.Element;
+
+let obj = {
+    yy: 10,
+    yy1: "hello"
+}
+
+let obj1 = {
+    yy: true
+}
+
+let obj2 = {
+    yy: 500,
+    "ignore-prop": "hello"
+}
+
+let defaultObj = undefined;
+
+// OK
+const c1 = <OneThing />
+const c2 = <OneThing {...obj}/>
+const c3 = <OneThing {...{}} />
+const c4 = <OneThing {...obj1} {...obj} />
+const c5 = <OneThing {...obj1} yy={42} {...{yy1: "hi"}}/>
+const c6 = <OneThing {...obj1} {...{yy: 10000, yy1: "true"}} />
+const c7 = <OneThing {...defaultObj} yy {...obj} />;  // No error. should pick second overload
+const c8 = <OneThing ignore-prop={100} />
+const c9 = <OneThing {...{ "ignore-prop":200 }} />;
+const c10 = <OneThing {...obj2} yy1="boo" />;
diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload3.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload3.tsx
new file mode 100644
index 0000000000000..5a21bcfe73675
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload3.tsx
@@ -0,0 +1,29 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @module: amd
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+interface Context {
+    color: any;
+}
+declare function ZeroThingOrTwoThing(): JSX.Element;
+declare function ZeroThingOrTwoThing(l: {yy: number, yy1: string}, context: Context): JSX.Element;
+
+let obj2 = undefined;
+
+// OK
+const two1 = <ZeroThingOrTwoThing />;
+const two2 = <ZeroThingOrTwoThing yy={100}  yy1="hello"/>;
+const two3 = <ZeroThingOrTwoThing {...obj2} />;  // it is just any so we allow it to pass through
+const two4 = <ZeroThingOrTwoThing  yy={1000} {...obj2} />;  // it is just any so we allow it to pass through
+const two5 = <ZeroThingOrTwoThing  {...obj2} yy={1000} />;  // it is just any so we allow it to pass through
+
+declare function ThreeThing(l: {y1: string}): JSX.Element;
+declare function ThreeThing(l: {y2: string}): JSX.Element;
+declare function ThreeThing(l: {yy: number, yy1: string}, context: Context, updater: any): JSX.Element;
+
+// OK
+const three1 = <ThreeThing yy={99} yy1="hello world" />;
+const three2 = <ThreeThing y2="Bye" />;
+const three3 = <ThreeThing {...obj2} y2={10} />;  // it is just any so we allow it to pass through
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload4.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload4.tsx
new file mode 100644
index 0000000000000..d94c7a5531c48
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload4.tsx
@@ -0,0 +1,39 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @module: amd
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react')
+declare function OneThing(): JSX.Element;
+declare function OneThing(l: {yy: number, yy1: string}): JSX.Element;
+
+let obj = {
+    yy: 10,
+    yy1: "hello"
+}
+let obj2 = undefined;
+
+// Error
+const c0 = <OneThing extraProp />;  // extra property;
+const c1 = <OneThing yy={10}/>;  // missing property;
+const c2 = <OneThing {...obj} yy1 />; // type incompatible;
+const c3 = <OneThing {...obj} {...{extra: "extra attr"}} />;  // Extra attribute;
+const c4 = <OneThing {...obj} y1={10000} />;  // extra property;
+const c5 = <OneThing {...obj} {...{yy: true}} />;  // type incompatible;
+const c6 = <OneThing {...obj2} {...{extra: "extra attr"}} />;  // Should error as there is extra attribute that doesn't match any. Current it is not
+const c7 = <OneThing {...obj2} yy />;  // Should error as there is extra attribute that doesn't match any. Current it is not
+
+declare function TestingOneThing(j: {"extra-data": string}): JSX.Element;
+declare function TestingOneThing(n: {yy: string, direction?: number}): JSX.Element;
+
+// Error
+const d1 = <TestingOneThing extra-data />
+const d2 = <TestingOneThing yy="hello" direction="left" />
+
+declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element;
+declare function TestingOptional(a: {y1: boolean, y2?: number, y3: boolean}): JSX.Element;
+
+// Error
+const e1 = <TestingOptional y1 y3="hello"/>
+const e2 = <TestingOptional y1="hello" y2={1000} y3 />
diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload5.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload5.tsx
new file mode 100644
index 0000000000000..8821d0adccec3
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload5.tsx
@@ -0,0 +1,62 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @module: amd
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react')
+
+export interface ClickableProps {
+    children?: string;
+    className?: string;
+}
+
+export interface ButtonProps extends ClickableProps {
+    onClick: React.MouseEventHandler<any>;
+}
+
+export interface LinkProps extends ClickableProps {
+    to: string;
+}
+
+export interface HyphenProps extends ClickableProps {
+    "data-format": string;
+}
+
+let obj0 = {
+    to: "world"
+};
+
+let obj1 = {
+    children: "hi",
+    to: "boo"
+}
+
+let obj2 = {
+    onClick: ()=>{}
+}
+
+let obj3 = undefined;
+
+export function MainButton(buttonProps: ButtonProps): JSX.Element;
+export function MainButton(linkProps: LinkProps): JSX.Element;
+export function MainButton(hyphenProps: HyphenProps): JSX.Element;
+export function MainButton(props: ButtonProps | LinkProps | HyphenProps): JSX.Element {
+    const linkProps = props as LinkProps;
+    if(linkProps.to) {
+        return this._buildMainLink(props);
+    }
+
+    return this._buildMainButton(props);
+}
+
+// Error
+const b0 = <MainButton to='/some/path' onClick={(e)=>{}}>GO</MainButton>;  // extra property;
+const b1 = <MainButton onClick={(e: any)=> {}} {...obj0}>Hello world</MainButton>;  // extra property;
+const b2 = <MainButton {...{to: "10000"}} {...obj2} />;  // extra property
+const b3 = <MainButton {...{to: "10000"}} {...{onClick: (k) => {}}} />;  // extra property
+const b4 = <MainButton {...obj3} to />;  // Shoudld erro because Incorrect type; but attributes are any so everything is allowed
+const b5 = <MainButton {...{ onclick(){} }} />;  // Spread doesn't retain method declaration
+const b6 = <MainButton {...{ onclick(){} }} children={10} />;  // incorrect type for optional attribute
+const b7 = <MainButton {...{ onclick(){} }} children="hello" className />;  // incorrect type for optional attribute
+const b8 = <MainButton data-format />;  // incorrect type for specified hyphanted name
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload6.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload6.tsx
new file mode 100644
index 0000000000000..2bd372eaa0d44
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload6.tsx
@@ -0,0 +1,62 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @module: amd
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react')
+
+export interface ClickableProps {
+    children?: string;
+    className?: string;
+}
+
+export interface ButtonProps extends ClickableProps {
+    onClick: React.MouseEventHandler<any>;
+}
+
+export interface LinkProps extends ClickableProps {
+    to: string;
+}
+
+export interface HyphenProps extends ClickableProps {
+    "data-format": string;
+}
+
+let obj = {
+    children: "hi",
+    to: "boo"
+}
+let obj1 = undefined;
+let obj2 = {
+    onClick: () => {}
+}
+
+export function MainButton(buttonProps: ButtonProps): JSX.Element;
+export function MainButton(linkProps: LinkProps): JSX.Element;
+export function MainButton(hyphenProps: HyphenProps): JSX.Element;
+export function MainButton(props: ButtonProps | LinkProps | HyphenProps): JSX.Element {
+    const linkProps = props as LinkProps;
+    if(linkProps.to) {
+        return this._buildMainLink(props);
+    }
+
+    return this._buildMainButton(props);
+}
+
+// OK
+const b0 = <MainButton to='/some/path'>GO</MainButton>;
+const b1 = <MainButton onClick={(e) => {}}>Hello world</MainButton>;
+const b2 = <MainButton {...obj} />;
+const b3 = <MainButton {...{to: 10000}} {...obj} />;
+const b4 = <MainButton {...obj1} />;  // any; just pick the first overload
+const b5 = <MainButton {...obj1} to="/to/somewhere" />;  // should pick the second overload
+const b6 = <MainButton {...obj2} />;
+const b7 = <MainButton {...{onClick: () => { console.log("hi") }}} />;
+const b8 = <MainButton {...obj} {...{onClick() {}}} />;  // OK; method declaration get discarded
+const b9 = <MainButton to='/some/path' extra-prop>GO</MainButton>;
+const b10 = <MainButton to='/some/path' children="hi" >GO</MainButton>;
+const b11 = <MainButton onClick={(e) => {}} className="hello" data-format>Hello world</MainButton>;
+const b12 = <MainButton data-format="Hello world" />
+
+
diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponents1.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponents1.tsx
index 5d64d22c757b5..6d7ffa21e0b91 100644
--- a/tests/cases/conformance/jsx/tsxStatelessFunctionComponents1.tsx
+++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponents1.tsx
@@ -9,17 +9,28 @@ function Greet(x: {name: string}) {
 function Meet({name = 'world'}) {
 	return <div>Hello, {name}</div>;
 }
+function MeetAndGreet(k: {"prop-name": string}) {
+	return <div>Hi Hi</div>;
+}
 
 // OK
 let a = <Greet name='world' />;
+let a1 = <Greet name='world' extra-prop />;
 // Error
 let b = <Greet naaame='world' />;
 
 // OK
 let c = <Meet />;
+let c1 = <Meet extra-prop/>;
 // OK
 let d = <Meet name='me' />;
 // Error
 let e = <Meet name={42} />;
 // Error
 let f = <Meet naaaaaaame='no' />;
+
+// OK
+let g = <MeetAndGreet prop-name="Bob" />;
+// Error
+let h = <MeetAndGreet extra-prop-name="World" />;
+
diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments1.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments1.tsx
new file mode 100644
index 0000000000000..3cae847122968
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments1.tsx
@@ -0,0 +1,45 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @module: amd
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react')
+
+
+declare function ComponentWithTwoAttributes<K,V>(l: {key1: K, value: V}): JSX.Element;
+
+// OK
+function Baz<T,U>(key1: T, value: U) {
+    let a0 = <ComponentWithTwoAttributes key1={key1} value={value} />
+    let a1 = <ComponentWithTwoAttributes {...{key1, value: value}} key="Component" />
+}
+
+// OK
+declare function Component<U>(l: U): JSX.Element;
+function createComponent<T extends {prop: number}>(arg:T) {
+    let a1 = <Component {...arg} />;
+    let a2 = <Component {...arg} prop1 />;
+}
+
+declare function ComponentSpecific<U>(l: {prop: U}): JSX.Element;
+declare function ComponentSpecific1<U>(l: {prop: U, "ignore-prop": number}): JSX.Element;
+
+// OK
+function Bar<T extends {prop: number}>(arg: T) {
+    let a1 = <ComponentSpecific {...arg} ignore-prop="hi" />;  // U is number
+    let a2 = <ComponentSpecific1 {...arg} ignore-prop={10} />;  // U is number
+    let a3 = <ComponentSpecific {...arg} prop="hello" />;   // U is "hello"
+}
+
+declare function Link<U>(l: {func: (arg: U)=>void}): JSX.Element;
+
+// OK
+function createLink(func: (a: number)=>void) {
+    let o = <Link func={func} />
+}
+
+function createLink1(func: (a: number)=>boolean) {
+    let o = <Link func={func} />
+}
+
diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments2.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments2.tsx
new file mode 100644
index 0000000000000..e264ffde2ff69
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments2.tsx
@@ -0,0 +1,27 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @module: amd
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react')
+
+declare function ComponentSpecific1<U>(l: {prop: U, "ignore-prop": string}): JSX.Element;
+declare function ComponentSpecific2<U>(l: {prop: U}): JSX.Element;
+
+// Error
+function Bar<T extends {prop: number}>(arg: T) {
+    let a1 = <ComponentSpecific1 {...arg} ignore-prop={10} />;
+ }
+
+// Error
+function Baz<T>(arg: T) {
+    let a0 = <ComponentSpecific1 {...arg} />
+}
+
+declare function Link<U>(l: {func: (arg: U)=>void}): JSX.Element;
+
+// Error
+function createLink(func: (a: number, b: string)=>void) {
+    let o = <Link func={func} />
+}
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments3.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments3.tsx
new file mode 100644
index 0000000000000..68285c450c039
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments3.tsx
@@ -0,0 +1,29 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @module: amd
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react')
+
+declare function OverloadComponent<U>(): JSX.Element;
+declare function OverloadComponent<U>(attr: {b: U, a?: string, "ignore-prop": boolean}): JSX.Element;
+declare function OverloadComponent<T, U>(attr: {b: U, a: T}): JSX.Element;
+
+// OK
+function Baz<T extends {b: number}, U extends {a: boolean, b:string}>(arg1: T, arg2: U) {
+    let a0 = <OverloadComponent {...arg1} a="hello" ignore-prop />;
+    let a1 = <OverloadComponent {...arg2} ignore-pro="hello world" />;
+    let a2 = <OverloadComponent {...arg2} />;
+    let a3 = <OverloadComponent {...arg1} ignore-prop />;
+    let a4 = <OverloadComponent />;
+    let a5 = <OverloadComponent {...arg2} ignore-prop="hello" {...arg1} />;
+    let a6 = <OverloadComponent {...arg2} ignore-prop {...arg1} />;
+}
+
+declare function Link<U>(l: {func: (arg: U)=>void}): JSX.Element;
+declare function Link<U>(l: {func: (arg1:U, arg2: string)=>void}): JSX.Element;
+function createLink(func: (a: number)=>void) {
+    let o = <Link func={func} />
+    let o1 = <Link func={(a:number, b:string)=>{}} />;
+}
\ No newline at end of file
diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments4.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments4.tsx
new file mode 100644
index 0000000000000..4be582dab5cd8
--- /dev/null
+++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments4.tsx
@@ -0,0 +1,17 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @module: amd
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react')
+
+declare function OverloadComponent<U>(): JSX.Element;
+declare function OverloadComponent<U>(attr: {b: U, a: string, "ignore-prop": boolean}): JSX.Element;
+declare function OverloadComponent<T, U>(attr: {b: U, a: T}): JSX.Element;
+
+// Error
+function Baz<T extends {b: number}, U extends {a: boolean, b:string}>(arg1: T, arg2: U) {
+    let a0 = <OverloadComponent a={arg1.b}/>
+    let a2 = <OverloadComponent {...arg1} ignore-prop />  // missing a
+}
\ No newline at end of file
diff --git a/tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes02.tsx b/tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes02.tsx
new file mode 100644
index 0000000000000..918f4507e2a87
--- /dev/null
+++ b/tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes02.tsx
@@ -0,0 +1,42 @@
+// @filename: file.tsx
+// @jsx: preserve
+// @module: amd
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+import React = require('react')
+
+export interface ClickableProps {
+    children?: string;
+    className?: string;
+}
+
+export interface ButtonProps extends ClickableProps {
+    onClick: (k: "left" | "right") => void;
+}
+
+export interface LinkProps extends ClickableProps {
+    goTo: "home" | "contact";
+}
+
+export function MainButton(buttonProps: ButtonProps): JSX.Element;
+export function MainButton(linkProps: LinkProps): JSX.Element;
+export function MainButton(props: ButtonProps | LinkProps): JSX.Element {
+    const linkProps = props as LinkProps;
+    if(linkProps.goTo) {
+        return this._buildMainLink(props);
+    }
+
+    return this._buildMainButton(props);
+}
+
+const b0 = <MainButton {...{onClick: (k) => {console.log(k)}}} extra />;  // k has type any
+const b2 = <MainButton onClick={(k)=>{console.log(k)}} extra />;  // k has type "left" | "right"
+const b3 = <MainButton {...{goTo:"home"}} extra />;  // goTo has type"home" | "contact"
+const b4 = <MainButton goTo="home" extra />;  // goTo has type "home" | "contact"
+
+export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined }
+const c1 = <NoOverload  {...{onClick: (k) => {console.log(k)}}} extra />;  // k has type any
+
+export function NoOverload1(linkProps: LinkProps): JSX.Element { return undefined }
+const d1 = <NoOverload1 {...{goTo:"home"}} extra  />;  // goTo has type "home" | "contact"
diff --git a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts
index b63386a68a31e..1e874aaf80f8a 100644
--- a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts
+++ b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts
@@ -7,6 +7,10 @@ class Shape {
     visible: boolean;
 }
 
+class TaggedShape extends Shape {
+    tag: string;
+}
+
 class Item {
     name: string;
     price: number;
@@ -149,6 +153,17 @@ function f32<K extends "width" | "height">(key: K) {
     return shape[key];  // Shape[K]
 }
 
+function f33<S extends Shape, K extends keyof S>(shape: S, key: K) {
+    let name = getProperty(shape, "name");
+    let prop = getProperty(shape, key);
+    return prop;
+}
+
+function f34(ts: TaggedShape) {
+    let tag1 = f33(ts, "tag");
+    let tag2 = getProperty(ts, "tag");
+}
+
 class C {
     public x: string;
     protected y: string;
@@ -164,4 +179,36 @@ function f40(c: C) {
     let x: X = c["x"];
     let y: Y = c["y"];
     let z: Z = c["z"];
+}
+
+// Repros from #12011
+
+class Base {
+    get<K extends keyof this>(prop: K) {
+        return this[prop];
+    }
+    set<K extends keyof this>(prop: K, value: this[K]) {
+        this[prop] = value;
+    }
+}
+
+class Person extends Base {
+    parts: number;
+    constructor(parts: number) {
+        super();
+        this.set("parts", parts);
+    }
+    getParts() {
+        return this.get("parts")
+    }
+}
+
+class OtherPerson {
+    parts: number;
+    constructor(parts: number) {
+        setProperty(this, "parts", parts);
+    }
+    getParts() {
+        return getProperty(this, "parts")
+    }
 }
\ No newline at end of file
diff --git a/tests/cases/fourslash/goToDefinitionObjectLiteralProperties1.ts b/tests/cases/fourslash/goToDefinitionObjectLiteralProperties1.ts
new file mode 100644
index 0000000000000..a1c22ca4ca395
--- /dev/null
+++ b/tests/cases/fourslash/goToDefinitionObjectLiteralProperties1.ts
@@ -0,0 +1,19 @@
+/// <reference path='fourslash.ts' />
+
+//// interface PropsBag {
+////    /*first*/propx: number
+//// }
+//// function foo(arg: PropsBag) {}
+//// foo({
+////    pr/*p1*/opx: 10
+//// })
+//// function bar(firstarg: boolean, secondarg: PropsBag) {}
+//// bar(true, {
+////    pr/*p2*/opx: 10
+//// })
+
+
+verify.goToDefinition({
+    p1: "first",
+    p2: "first"
+});
diff --git a/tests/cases/fourslash/tsxCompletion12.ts b/tests/cases/fourslash/tsxCompletion12.ts
new file mode 100644
index 0000000000000..542dbec2c2b7b
--- /dev/null
+++ b/tests/cases/fourslash/tsxCompletion12.ts
@@ -0,0 +1,47 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface OptionPropBag {
+////     propx: number
+////     propString: "hell"
+////     optional?: boolean
+//// }
+//// declare function Opt(attributes: OptionPropBag): JSX.Element;
+//// let opt = <Opt /*1*/ />;
+//// let opt1 = <Opt prop/*2*/ />;
+//// let opt2 = <Opt propx={100} /*3*/ />;
+//// let opt3 = <Opt propx={100} optional /*4*/ />;
+//// let opt4 = <Opt wrong /*5*/ />;
+
+goTo.marker("1");
+verify.completionListContains('propx');
+verify.completionListContains('propString');
+verify.completionListContains('optional');
+
+goTo.marker("2");
+verify.completionListContains('propx');
+verify.completionListContains('propString');
+
+goTo.marker("3");
+verify.completionListContains("propString")
+verify.completionListContains("optional")
+verify.not.completionListContains("propx")
+
+goTo.marker("4");
+verify.completionListContains("propString");
+verify.not.completionListContains("propx");
+verify.not.completionListContains("optional");
+
+goTo.marker("5");
+verify.completionListContains('propx');
+verify.completionListContains('propString');
+verify.completionListContains('optional');
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxCompletion13.ts b/tests/cases/fourslash/tsxCompletion13.ts
new file mode 100644
index 0000000000000..60964acbc5530
--- /dev/null
+++ b/tests/cases/fourslash/tsxCompletion13.ts
@@ -0,0 +1,62 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface ClickableProps {
+////     children?: string;
+////     className?: string;
+//// }
+//// interface ButtonProps extends ClickableProps {
+////     onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
+//// }
+//// interface LinkProps extends ClickableProps {
+////     goTo: string;
+//// }
+//// declare function MainButton(buttonProps: ButtonProps): JSX.Element;
+//// declare function MainButton(linkProps: LinkProps): JSX.Element;
+//// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
+//// let opt = <MainButton /*1*/ />;
+//// let opt = <MainButton children="chidlren" /*2*/ />;
+//// let opt = <MainButton onClick={()=>{}} /*3*/ />;
+//// let opt = <MainButton onClick={()=>{}} ignore-prop /*4*/ />;
+//// let opt = <MainButton goTo="goTo" /*5*/ />;
+//// let opt = <MainButton wrong /*6*/ />;
+
+goTo.marker("1");
+verify.completionListContains('children');
+verify.completionListContains('className');
+verify.completionListContains('onClick');
+verify.completionListContains('goTo');
+
+goTo.marker("2");
+verify.completionListContains('className');
+verify.completionListContains('onClick');
+verify.completionListContains('goTo');
+
+goTo.marker("3");
+verify.completionListContains('children');
+verify.completionListContains('className');
+verify.not.completionListContains('goTo');
+
+goTo.marker("4");
+verify.completionListContains('children');
+verify.completionListContains('className');
+
+goTo.marker("5");
+verify.completionListContains('children');
+verify.completionListContains('className');
+verify.not.completionListContains('onClick');
+
+goTo.marker("6");
+verify.completionListContains('children');
+verify.completionListContains('className');
+verify.completionListContains('onClick');
+verify.completionListContains('goTo');
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxFindAllReferences1.ts b/tests/cases/fourslash/tsxFindAllReferences1.ts
new file mode 100644
index 0000000000000..9b55901ba68c9
--- /dev/null
+++ b/tests/cases/fourslash/tsxFindAllReferences1.ts
@@ -0,0 +1,16 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////         [|div|]: {
+////             name?: string;
+////             isOpen?: boolean;
+////         };
+////         span: { n: string; };
+////     }
+//// }
+//// var x = <[|div|] />;
+
+verify.rangesReferenceEachOther();
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxFindAllReferences10.ts b/tests/cases/fourslash/tsxFindAllReferences10.ts
new file mode 100644
index 0000000000000..a027671ec3d4d
--- /dev/null
+++ b/tests/cases/fourslash/tsxFindAllReferences10.ts
@@ -0,0 +1,33 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface ClickableProps {
+////     children?: string;
+////     className?: string;
+//// }
+//// interface ButtonProps extends ClickableProps {
+////     [|onClick|](event?: React.MouseEvent<HTMLButtonElement>): void;
+//// }
+//// interface LinkProps extends ClickableProps {
+////     goTo: string;
+//// }
+//// declare function MainButton(buttonProps: ButtonProps): JSX.Element;
+//// declare function MainButton(linkProps: LinkProps): JSX.Element;
+//// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
+//// let opt = <MainButton />;
+//// let opt = <MainButton children="chidlren" />;
+//// let opt = <MainButton [|onClick|]={()=>{}} />;
+//// let opt = <MainButton [|onClick|]={()=>{}} ignore-prop />;
+//// let opt = <MainButton goTo="goTo" />;
+//// let opt = <MainButton wrong />;
+
+verify.rangesReferenceEachOther();
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxFindAllReferences11.ts b/tests/cases/fourslash/tsxFindAllReferences11.ts
new file mode 100644
index 0000000000000..ef2f7722243ed
--- /dev/null
+++ b/tests/cases/fourslash/tsxFindAllReferences11.ts
@@ -0,0 +1,29 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface ClickableProps {
+////     children?: string;
+////     className?: string;
+//// }
+//// interface ButtonProps extends ClickableProps {
+////     onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
+//// }
+//// interface LinkProps extends ClickableProps {
+////     goTo: string;
+//// }
+//// declare function MainButton(buttonProps: ButtonProps): JSX.Element;
+//// declare function MainButton(linkProps: LinkProps): JSX.Element;
+//// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
+//// let opt = <MainButton [|wrong|] />;  // r1
+
+const [r1] = test.ranges();
+verify.referencesOf(r1, [r1]);
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxFindAllReferences2.ts b/tests/cases/fourslash/tsxFindAllReferences2.ts
new file mode 100644
index 0000000000000..8522874865a59
--- /dev/null
+++ b/tests/cases/fourslash/tsxFindAllReferences2.ts
@@ -0,0 +1,16 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////         div: {
+////             [|name|]?: string;
+////             isOpen?: boolean;
+////         };
+////         span: { n: string; };
+////     }
+//// }
+//// var x = <div [|name|]="hello" />;
+
+verify.rangesReferenceEachOther();
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxFindAllReferences3.ts b/tests/cases/fourslash/tsxFindAllReferences3.ts
new file mode 100644
index 0000000000000..2f78cc08ba979
--- /dev/null
+++ b/tests/cases/fourslash/tsxFindAllReferences3.ts
@@ -0,0 +1,19 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props }
+//// }
+//// class MyClass {
+////   props: {
+////     [|name|]?: string;
+////     size?: number;
+//// }
+//// 
+//// 
+//// var x = <MyClass [|name|]='hello'/>;
+
+verify.rangesReferenceEachOther();
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxFindAllReferences4.ts b/tests/cases/fourslash/tsxFindAllReferences4.ts
new file mode 100644
index 0000000000000..a1309bfaef961
--- /dev/null
+++ b/tests/cases/fourslash/tsxFindAllReferences4.ts
@@ -0,0 +1,19 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props }
+//// }
+//// class [|MyClass|] {
+////   props: {
+////     name?: string;
+////     size?: number;
+//// }
+//// 
+//// 
+//// var x = <[|MyClass|] name='hello'></[|MyClass|]>;
+
+verify.rangesReferenceEachOther();
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxFindAllReferences5.ts b/tests/cases/fourslash/tsxFindAllReferences5.ts
new file mode 100644
index 0000000000000..018b7568df15a
--- /dev/null
+++ b/tests/cases/fourslash/tsxFindAllReferences5.ts
@@ -0,0 +1,25 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface OptionPropBag {
+////     propx: number
+////     propString: string
+////     optional?: boolean
+//// }
+//// declare function [|Opt|](attributes: OptionPropBag): JSX.Element;
+//// let opt = <[|Opt|] />;
+//// let opt1 = <[|Opt|] propx={100} propString />;
+//// let opt2 = <[|Opt|] propx={100} optional/>;
+//// let opt3 = <[|Opt|] wrong />;
+//// let opt4 = <[|Opt|] propx={100} propString="hi" />;
+
+verify.rangesReferenceEachOther();
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxFindAllReferences6.ts b/tests/cases/fourslash/tsxFindAllReferences6.ts
new file mode 100644
index 0000000000000..ad689a53baff1
--- /dev/null
+++ b/tests/cases/fourslash/tsxFindAllReferences6.ts
@@ -0,0 +1,23 @@
+/// <reference path='fourslash.ts' />
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface OptionPropBag {
+////     propx: number
+////     propString: string
+////     optional?: boolean
+//// }
+//// declare function Opt(attributes: OptionPropBag): JSX.Element;
+//// let opt = <Opt [|wrong|] />;  //r1
+
+const [r1] = test.ranges();
+verify.referencesOf(r1, [r1]);
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxFindAllReferences7.ts b/tests/cases/fourslash/tsxFindAllReferences7.ts
new file mode 100644
index 0000000000000..b1f5231a19859
--- /dev/null
+++ b/tests/cases/fourslash/tsxFindAllReferences7.ts
@@ -0,0 +1,24 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface OptionPropBag {
+////     [|propx|]: number
+////     propString: string
+////     optional?: boolean
+//// }
+//// declare function Opt(attributes: OptionPropBag): JSX.Element;
+//// let opt = <Opt />;
+//// let opt1 = <Opt [|propx|]={100} propString />;
+//// let opt2 = <Opt [|propx|]={100} optional/>;
+//// let opt3 = <Opt wrong />;
+
+verify.rangesReferenceEachOther();
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxFindAllReferences8.ts b/tests/cases/fourslash/tsxFindAllReferences8.ts
new file mode 100644
index 0000000000000..434e8cf330380
--- /dev/null
+++ b/tests/cases/fourslash/tsxFindAllReferences8.ts
@@ -0,0 +1,33 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface ClickableProps {
+////     children?: string;
+////     className?: string;
+//// }
+//// interface ButtonProps extends ClickableProps {
+////     onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
+//// }
+//// interface LinkProps extends ClickableProps {
+////     goTo: string;
+//// }
+//// declare function [|MainButton|](buttonProps: ButtonProps): JSX.Element;
+//// declare function [|MainButton|](linkProps: LinkProps): JSX.Element;
+//// declare function [|MainButton|](props: ButtonProps | LinkProps): JSX.Element;
+//// let opt = <[|MainButton|] />;
+//// let opt = <[|MainButton|] children="chidlren" />;
+//// let opt = <[|MainButton|] onClick={()=>{}} />;
+//// let opt = <[|MainButton|] onClick={()=>{}} ignore-prop />;
+//// let opt = <[|MainButton|] goTo="goTo" />;
+//// let opt = <[|MainButton|] wrong />;
+
+verify.rangesReferenceEachOther();
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxFindAllReferences9.ts b/tests/cases/fourslash/tsxFindAllReferences9.ts
new file mode 100644
index 0000000000000..5ac6ad344d8c3
--- /dev/null
+++ b/tests/cases/fourslash/tsxFindAllReferences9.ts
@@ -0,0 +1,34 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface ClickableProps {
+////     children?: string;
+////     className?: string;
+//// }
+//// interface ButtonProps extends ClickableProps {
+////     onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
+//// }
+//// interface LinkProps extends ClickableProps {
+////     [|goTo|]: string;
+//// }
+//// declare function MainButton(buttonProps: ButtonProps): JSX.Element;
+//// declare function MainButton(linkProps: LinkProps): JSX.Element;
+//// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
+//// let opt = <MainButton />;
+//// let opt = <MainButton children="chidlren" />;
+//// let opt = <MainButton onClick={()=>{}} />;
+//// let opt = <MainButton onClick={()=>{}} ignore-prop />;
+//// let opt = <MainButton [|goTo|]="goTo" />;
+//// let opt = <MainButton [|goTo|] />;
+//// let opt = <MainButton wrong />;
+
+verify.rangesReferenceEachOther();
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxGoToDefinitionClasses.ts b/tests/cases/fourslash/tsxGoToDefinitionClasses.ts
index 9c54834534d34..a3ca3057908d1 100644
--- a/tests/cases/fourslash/tsxGoToDefinitionClasses.ts
+++ b/tests/cases/fourslash/tsxGoToDefinitionClasses.ts
@@ -13,8 +13,10 @@
 //// }
 //// var x = <My/*c*/Class />;
 //// var y = <MyClass f/*p*/oo= 'hello' />;
+//// var z = <MyCl/*w*/ass wrong= 'hello' />;
 
 verify.goToDefinition({
     c: "ct",
-    p: "pt"
+    p: "pt",
+    w: "ct"
 });
diff --git a/tests/cases/fourslash/tsxGoToDefinitionStatelessFunction1.ts b/tests/cases/fourslash/tsxGoToDefinitionStatelessFunction1.ts
new file mode 100644
index 0000000000000..d715dc5b20445
--- /dev/null
+++ b/tests/cases/fourslash/tsxGoToDefinitionStatelessFunction1.ts
@@ -0,0 +1,31 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface OptionPropBag {
+////     /*pt1*/propx: number
+////     propString: "hell"
+////     /*pt2*/optional?: boolean
+//// }
+//// /*opt*/declare function Opt(attributes: OptionPropBag): JSX.Element;
+//// let opt = <O/*one*/pt />;
+//// let opt1 = <Op/*two*/t pr/*p1*/opx={100} />;
+//// let opt2 = <Op/*three*/t propx={100} opt/*p2*/ional />;
+//// let opt3 = <Op/*four*/t wr/*p3*/ong />;
+
+verify.goToDefinition({
+    one: "opt",
+    two: "opt",
+    three: "opt",
+    four: "opt",
+    p1: "pt1",
+    p2: "pt2"
+});
diff --git a/tests/cases/fourslash/tsxGoToDefinitionStatelessFunction2.ts b/tests/cases/fourslash/tsxGoToDefinitionStatelessFunction2.ts
new file mode 100644
index 0000000000000..77eb08648289f
--- /dev/null
+++ b/tests/cases/fourslash/tsxGoToDefinitionStatelessFunction2.ts
@@ -0,0 +1,40 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface ClickableProps {
+////     children?: string;
+////     className?: string;
+//// }
+//// interface ButtonProps extends ClickableProps {
+////     onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
+//// }
+//// interface LinkProps extends ClickableProps {
+////     goTo: string;
+//// }
+//// /*firstSource*/declare function MainButton(buttonProps: ButtonProps): JSX.Element;
+//// /*secondSource*/declare function MainButton(linkProps: LinkProps): JSX.Element;
+//// /*thirdSource*/declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
+//// let opt = <Main/*firstTarget*/Button />;
+//// let opt = <Main/*secondTarget*/Button children="chidlren" />;
+//// let opt = <Main/*thirdTarget*/Button onClick={()=>{}} />;
+//// let opt = <Main/*fourthTarget*/Button onClick={()=>{}} ignore-prop />;
+//// let opt = <Main/*fivethTarget*/Button goTo="goTo" />;
+//// let opt = <Main/*sixthTarget*/Button wrong />;
+
+verify.goToDefinition({
+    firstTarget: "firstSource",
+    secondTarget: "firstSource",
+    thirdTarget: "firstSource",
+    fourthTarget: "firstSource",
+    fivethTarget: "secondSource",
+    sixthTarget: "firstSource"
+});
diff --git a/tests/cases/fourslash/tsxQuickInfo3.ts b/tests/cases/fourslash/tsxQuickInfo3.ts
new file mode 100644
index 0000000000000..614ffa878ef09
--- /dev/null
+++ b/tests/cases/fourslash/tsxQuickInfo3.ts
@@ -0,0 +1,30 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// interface OptionProp {
+////     propx: 2
+//// }
+
+//// class Opt extends React.Component<OptionProp, {}> {
+////     render() {
+////         return <div>Hello</div>;
+////     }
+//// }
+
+//// const obj1: OptionProp = {
+////     propx: 2
+//// }
+
+//// let y1 = <O/*1*/pt pro/*2*/px={2} />;
+//// let y2 = <Opt {...ob/*3*/j1} />;
+//// let y2 = <Opt {...obj1} pr/*4*/opx />;
+
+verify.quickInfos({
+    1: "class Opt",
+    2: "(JSX attribute) propx: number",
+    3: "const obj1: OptionProp",
+    4: "(JSX attribute) propx: true"
+});
diff --git a/tests/cases/fourslash/tsxQuickInfo4.ts b/tests/cases/fourslash/tsxQuickInfo4.ts
new file mode 100644
index 0000000000000..d9f566571aafd
--- /dev/null
+++ b/tests/cases/fourslash/tsxQuickInfo4.ts
@@ -0,0 +1,55 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// export interface ClickableProps {
+////     children?: string;
+////     className?: string;
+//// }
+
+//// export interface ButtonProps extends ClickableProps {
+////     onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
+//// }
+
+//// export interface LinkProps extends ClickableProps {
+////     to: string;
+//// }
+
+//// export function MainButton(buttonProps: ButtonProps): JSX.Element;
+//// export function MainButton(linkProps: LinkProps): JSX.Element;
+//// export function MainButton(props: ButtonProps | LinkProps): JSX.Element {
+////     const linkProps = props as LinkProps;
+////     if(linkProps.to) {
+////         return this._buildMainLink(props);
+////     }
+////     return this._buildMainButton(props);
+//// }
+
+//// function _buildMainButton({ onClick, children, className }: ButtonProps): JSX.Element {
+////     return(<button className={className} onClick={onClick}>{ children || 'MAIN BUTTON'}</button>);  
+//// }
+
+//// declare function buildMainLink({ to, children, className }: LinkProps): JSX.Element;
+
+//// function buildSomeElement1(): JSX.Element {
+////     return (
+////         <MainB/*1*/utton t/*2*/o='/some/path'>GO</MainButton>
+////     );
+//// }
+
+//// function buildSomeElement2(): JSX.Element {  
+////     return (
+////         <MainB/*3*/utton onC/*4*/lick={()=>{}}>GO</MainButton>;
+////     );
+//// }
+//// let componenet = <MainButton onClick={()=>{}} ext/*5*/ra-prop>GO</MainButton>;  
+
+verify.quickInfos({
+    1: "function MainButton(linkProps: LinkProps): any (+1 overload)",
+    2: "(JSX attribute) to: string",
+    3: "function MainButton(buttonProps: ButtonProps): any (+1 overload)",
+    4: "(JSX attribute) onClick: () => void",
+    5: "(JSX attribute) extra-prop: true"
+});
diff --git a/tests/cases/fourslash/tsxQuickInfo5.ts b/tests/cases/fourslash/tsxQuickInfo5.ts
new file mode 100644
index 0000000000000..cbdecb67da717
--- /dev/null
+++ b/tests/cases/fourslash/tsxQuickInfo5.ts
@@ -0,0 +1,18 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare function ComponentWithTwoAttributes<K,V>(l: {key1: K, value: V}): JSX.Element;
+
+//// function Baz<T,U>(key1: T, value: U) {
+////     let a0 = <ComponentWi/*1*/thTwoAttributes k/*2*/ey1={key1} val/*3*/ue={value} />
+////     let a1 = <ComponentWithTwoAttributes {...{key1, value: value}} key="Component" />
+//// }
+
+verify.quickInfos({
+    1: "function ComponentWithTwoAttributes<T, U>(l: {\n    key1: T;\n    value: U;\n}): any",
+    2: "(JSX attribute) key1: T",
+    3: "(JSX attribute) value: U",
+});
diff --git a/tests/cases/fourslash/tsxQuickInfo6.ts b/tests/cases/fourslash/tsxQuickInfo6.ts
new file mode 100644
index 0000000000000..88d9435e801f7
--- /dev/null
+++ b/tests/cases/fourslash/tsxQuickInfo6.ts
@@ -0,0 +1,19 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare function ComponentSpecific<U>(l: {prop: U}): JSX.Element;
+//// declare function ComponentSpecific1<U>(l: {prop: U, "ignore-prop": number}): JSX.Element;
+
+//// function Bar<T extends {prop: number}>(arg: T) {
+////     let a1 = <Compone/*1*/ntSpecific {...arg} ignore-prop="hi" />;  // U is number
+////     let a2 = <ComponentSpecific1 {...arg} ignore-prop={10} />;  // U is number
+////     let a3 = <Component/*2*/Specific {...arg} prop="hello" />;   // U is "hello"
+//// }
+
+verify.quickInfos({
+    1: "function ComponentSpecific<number>(l: {\n    prop: number;\n}): any",
+    2: "function ComponentSpecific<\"hello\">(l: {\n    prop: \"hello\";\n}): any"
+});
diff --git a/tests/cases/fourslash/tsxQuickInfo7.ts b/tests/cases/fourslash/tsxQuickInfo7.ts
new file mode 100644
index 0000000000000..0405690181fbf
--- /dev/null
+++ b/tests/cases/fourslash/tsxQuickInfo7.ts
@@ -0,0 +1,29 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare function OverloadComponent(): JSX.Element;
+//// declare function OverloadComponent<U>(attr: {b: U, a?: string, "ignore-prop": boolean}): JSX.Element;
+//// declare function OverloadComponent<T, U>(attr: {b: U, a: T}): JSX.Element;
+
+//// function Baz<T extends {b: number}, U extends {a: boolean, b:string}>(arg1: T, arg2: U) {
+////     let a0 = <Overloa/*1*/dComponent {...arg1} a="hello" ignore-prop />;
+////     let a1 = <Overloa/*2*/dComponent {...arg2} ignore-pro="hello world" />;
+////     let a2 = <Overloa/*3*/dComponent {...arg2} />;
+////     let a3 = <Overloa/*4*/dComponent {...arg1} ignore-prop />;
+////     let a4 = <Overloa/*5*/dComponent />;
+////     let a5 = <Overloa/*6*/dComponent {...arg2} ignore-prop="hello" {...arg1} />;
+////     let a6 = <Overloa/*7*/dComponent {...arg2} ignore-prop {...arg1} />;
+//// }
+
+verify.quickInfos({
+    1: "function OverloadComponent<number>(attr: {\n    b: number;\n    a?: string;\n    \"ignore-prop\": boolean;\n}): any (+2 overloads)",
+    2: "function OverloadComponent<boolean, string>(attr: {\n    b: string;\n    a: boolean;\n}): any (+2 overloads)",
+    3: "function OverloadComponent<boolean, string>(attr: {\n    b: string;\n    a: boolean;\n}): any (+2 overloads)",
+    4: "function OverloadComponent<number>(attr: {\n    b: number;\n    a?: string;\n    \"ignore-prop\": boolean;\n}): any (+2 overloads)",
+    5: "function OverloadComponent(): any (+2 overloads)",
+    6: "function OverloadComponent<boolean, number>(attr: {\n    b: number;\n    a: boolean;\n}): any (+2 overloads)",
+    7: "function OverloadComponent<boolean, number>(attr: {\n    b: number;\n    a: boolean;\n}): any (+2 overloads)"
+});
diff --git a/tests/cases/fourslash/tsxRename10.ts b/tests/cases/fourslash/tsxRename10.ts
new file mode 100644
index 0000000000000..091f5aa976fe4
--- /dev/null
+++ b/tests/cases/fourslash/tsxRename10.ts
@@ -0,0 +1,40 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface ClickableProps {
+////     children?: string;
+////     className?: string;
+//// }
+//// interface ButtonProps extends ClickableProps {
+////     onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
+//// }
+//// interface LinkProps extends ClickableProps {
+////     [|goTo|]: string;
+//// }
+//// declare function MainButton(buttonProps: ButtonProps): JSX.Element;
+//// declare function MainButton(linkProps: LinkProps): JSX.Element;
+//// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
+//// let opt = <MainButton />;
+//// let opt = <MainButton children="chidlren" />;
+//// let opt = <MainButton onClick={()=>{}} />;
+//// let opt = <MainButton onClick={()=>{}} ignore-prop />;
+//// let opt = <MainButton [|goTo|]="goTo" />;
+//// let opt = <MainButton [|goTo|] />;
+//// let opt = <MainButton wrong />;
+
+
+let ranges = test.ranges();
+verify.assertHasRanges(ranges);
+for (let range of ranges) {
+    goTo.position(range.start);
+    verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
+}
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxRename11.ts b/tests/cases/fourslash/tsxRename11.ts
new file mode 100644
index 0000000000000..97933dd0cc9b2
--- /dev/null
+++ b/tests/cases/fourslash/tsxRename11.ts
@@ -0,0 +1,39 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface ClickableProps {
+////     children?: string;
+////     className?: string;
+//// }
+//// interface ButtonProps extends ClickableProps {
+////     [|onClick|](event?: React.MouseEvent<HTMLButtonElement>): void;
+//// }
+//// interface LinkProps extends ClickableProps {
+////     goTo: string;
+//// }
+//// declare function MainButton(buttonProps: ButtonProps): JSX.Element;
+//// declare function MainButton(linkProps: LinkProps): JSX.Element;
+//// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
+//// let opt = <MainButton />;
+//// let opt = <MainButton children="chidlren" />;
+//// let opt = <MainButton [|onClick|]={()=>{}} />;
+//// let opt = <MainButton [|onClick|]={()=>{}} ignore-prop />;
+//// let opt = <MainButton goTo="goTo" />;
+//// let opt = <MainButton wrong />;
+
+
+let ranges = test.ranges();
+verify.assertHasRanges(ranges);
+for (let range of ranges) {
+    goTo.position(range.start);
+    verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
+}
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxRename12.ts b/tests/cases/fourslash/tsxRename12.ts
new file mode 100644
index 0000000000000..30e6b506f4d71
--- /dev/null
+++ b/tests/cases/fourslash/tsxRename12.ts
@@ -0,0 +1,39 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface ClickableProps {
+////     children?: string;
+////     className?: string;
+//// }
+//// interface ButtonProps extends ClickableProps {
+////     onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
+//// }
+//// interface LinkProps extends ClickableProps {
+////     goTo: string;
+//// }
+//// declare function MainButton(buttonProps: ButtonProps): JSX.Element;
+//// declare function MainButton(linkProps: LinkProps): JSX.Element;
+//// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
+//// let opt = <MainButton />;
+//// let opt = <MainButton children="chidlren" />;
+//// let opt = <MainButton onClick={()=>{}} />;
+//// let opt = <MainButton onClick={()=>{}} ignore-prop />;
+//// let opt = <MainButton goTo="goTo" />;
+//// let opt = <MainButton [|wrong|] />;
+
+
+let ranges = test.ranges();
+verify.assertHasRanges(ranges);
+for (let range of ranges) {
+    goTo.position(range.start);
+    verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
+}
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxRename13.ts b/tests/cases/fourslash/tsxRename13.ts
new file mode 100644
index 0000000000000..02d0fb1b3dd2a
--- /dev/null
+++ b/tests/cases/fourslash/tsxRename13.ts
@@ -0,0 +1,39 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface ClickableProps {
+////     children?: string;
+////     className?: string;
+//// }
+//// interface ButtonProps extends ClickableProps {
+////     onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
+//// }
+//// interface LinkProps extends ClickableProps {
+////     goTo: string;
+//// }
+//// declare function MainButton(buttonProps: ButtonProps): JSX.Element;
+//// declare function MainButton(linkProps: LinkProps): JSX.Element;
+//// declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
+//// let opt = <MainButton />;
+//// let opt = <MainButton children="chidlren" />;
+//// let opt = <MainButton onClick={()=>{}} />;
+//// let opt = <MainButton onClick={()=>{}} [|ignore-prop|] />;
+//// let opt = <MainButton goTo="goTo" />;
+//// let opt = <MainButton wrong />;
+
+
+let ranges = test.ranges();
+verify.assertHasRanges(ranges);
+for (let range of ranges) {
+    goTo.position(range.start);
+    verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
+}
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxRename6.ts b/tests/cases/fourslash/tsxRename6.ts
new file mode 100644
index 0000000000000..59bc3f480099c
--- /dev/null
+++ b/tests/cases/fourslash/tsxRename6.ts
@@ -0,0 +1,30 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface OptionPropBag {
+////     propx: number
+////     propString: string
+////     optional?: boolean
+//// }
+//// declare function [|Opt|](attributes: OptionPropBag): JSX.Element;
+//// let opt = <[|Opt|] />;
+//// let opt1 = <[|Opt|] propx={100} propString />;
+//// let opt2 = <[|Opt|] propx={100} optional/>;
+//// let opt3 = <[|Opt|] wrong />;
+//// let opt4 = <[|Opt|] propx={100} propString="hi" />;
+
+let ranges = test.ranges();
+verify.assertHasRanges(ranges);
+for (let range of ranges) {
+    goTo.position(range.start);
+    verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
+}
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxRename7.ts b/tests/cases/fourslash/tsxRename7.ts
new file mode 100644
index 0000000000000..b5d05e49bd36b
--- /dev/null
+++ b/tests/cases/fourslash/tsxRename7.ts
@@ -0,0 +1,29 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface OptionPropBag {
+////     [|propx|]: number
+////     propString: string
+////     optional?: boolean
+//// }
+//// declare function Opt(attributes: OptionPropBag): JSX.Element;
+//// let opt = <Opt />;
+//// let opt1 = <Opt [|propx|]={100} propString />;
+//// let opt2 = <Opt [|propx|]={100} optional/>;
+//// let opt3 = <Opt wrong />;
+
+let ranges = test.ranges();
+verify.assertHasRanges(ranges);
+for (let range of ranges) {
+    goTo.position(range.start);
+    verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
+}
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxRename8.ts b/tests/cases/fourslash/tsxRename8.ts
new file mode 100644
index 0000000000000..48bbff0d88e19
--- /dev/null
+++ b/tests/cases/fourslash/tsxRename8.ts
@@ -0,0 +1,31 @@
+/// <reference path='fourslash.ts' />
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface OptionPropBag {
+////     propx: number
+////     propString: string
+////     optional?: boolean
+//// }
+//// declare function Opt(attributes: OptionPropBag): JSX.Element;
+//// let opt = <Opt />;
+//// let opt1 = <Opt propx={100} propString />;
+//// let opt2 = <Opt propx={100} optional/>;
+//// let opt3 = <Opt [|wrong|] />;
+//// let opt4 = <Opt propx={100} propString="hi" />;
+
+let ranges = test.ranges();
+verify.assertHasRanges(ranges);
+for (let range of ranges) {
+    goTo.position(range.start);
+    verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
+}
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxRename9.ts b/tests/cases/fourslash/tsxRename9.ts
new file mode 100644
index 0000000000000..4d132f5eac9d6
--- /dev/null
+++ b/tests/cases/fourslash/tsxRename9.ts
@@ -0,0 +1,38 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+
+//// declare module JSX {
+////     interface Element { }
+////     interface IntrinsicElements {
+////     }
+////     interface ElementAttributesProperty { props; }
+//// }
+//// interface ClickableProps {
+////     children?: string;
+////     className?: string;
+//// }
+//// interface ButtonProps extends ClickableProps {
+////     onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
+//// }
+//// interface LinkProps extends ClickableProps {
+////     goTo: string;
+//// }
+//// declare function [|MainButton|](buttonProps: ButtonProps): JSX.Element;
+//// declare function [|MainButton|](linkProps: LinkProps): JSX.Element;
+//// declare function [|MainButton|](props: ButtonProps | LinkProps): JSX.Element;
+//// let opt = <[|MainButton|] />;
+//// let opt = <[|MainButton|] children="chidlren" />;
+//// let opt = <[|MainButton|] onClick={()=>{}} />;
+//// let opt = <[|MainButton|] onClick={()=>{}} ignore-prop />;
+//// let opt = <[|MainButton|] goTo="goTo" />;
+//// let opt = <[|MainButton|] wrong />;
+
+let ranges = test.ranges();
+verify.assertHasRanges(ranges);
+for (let range of ranges) {
+    goTo.position(range.start);
+    verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false);
+}
\ No newline at end of file
diff --git a/tests/cases/fourslash/tsxSignatureHelp1.ts b/tests/cases/fourslash/tsxSignatureHelp1.ts
new file mode 100644
index 0000000000000..a0fd59d11ecda
--- /dev/null
+++ b/tests/cases/fourslash/tsxSignatureHelp1.ts
@@ -0,0 +1,35 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+//// import React = require('react');
+//// export interface ClickableProps {
+////     children?: string;
+////     className?: string;
+//// }
+
+//// export interface ButtonProps extends ClickableProps {
+////     onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
+//// }
+
+//// function _buildMainButton({ onClick, children, className }: ButtonProps): JSX.Element {
+////     return(<button className={className} onClick={onClick}>{ children || 'MAIN BUTTON'}</button>);  
+//// }
+
+//// export function MainButton(props: ButtonProps): JSX.Element {
+////     return this._buildMainButton(props);
+//// }
+//// let e1 = <MainButton/*1*/ /*2*/
+
+goTo.marker("1");
+verify.signatureHelpCountIs(1);
+verify.currentSignatureHelpIs("MainButton(props: ButtonProps): any");
+verify.currentParameterSpanIs("props: ButtonProps");
+
+goTo.marker("2");
+verify.signatureHelpCountIs(1);
+verify.currentSignatureHelpIs("MainButton(props: ButtonProps): any");
+verify.currentParameterSpanIs("props: ButtonProps");
diff --git a/tests/cases/fourslash/tsxSignatureHelp2.ts b/tests/cases/fourslash/tsxSignatureHelp2.ts
new file mode 100644
index 0000000000000..a780a1603e16a
--- /dev/null
+++ b/tests/cases/fourslash/tsxSignatureHelp2.ts
@@ -0,0 +1,42 @@
+/// <reference path='fourslash.ts' />
+
+//@Filename: file.tsx
+// @jsx: preserve
+// @noLib: true
+// @libFiles: react.d.ts,lib.d.ts
+
+//// import React = require('react');
+//// export interface ClickableProps {
+////     children?: string;
+////     className?: string;
+//// }
+
+//// export interface ButtonProps extends ClickableProps {
+////     onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
+//// }
+
+//// export interface LinkProps extends ClickableProps {
+////     goTo(where: "home" | "contact"): void;
+//// }
+
+//// function _buildMainButton({ onClick, children, className }: ButtonProps): JSX.Element {
+////     return(<button className={className} onClick={onClick}>{ children || 'MAIN BUTTON'}</button>);  
+//// }
+
+//// export function MainButton(buttonProps: ButtonProps): JSX.Element;
+//// export function MainButton(linkProps: LinkProps): JSX.Element;
+//// export function MainButton(props: ButtonProps | LinkProps): JSX.Element {
+////     return this._buildMainButton(props);
+//// }
+//// let e1 = <MainButton/*1*/ /*2*/
+
+goTo.marker("1");
+// The second overload is chosen because the first doesn't get selected by choose overload as it has incorrect arity
+verify.signatureHelpCountIs(2);
+verify.currentSignatureHelpIs("MainButton(buttonProps: ButtonProps): any");
+verify.currentParameterSpanIs("buttonProps: ButtonProps");
+
+goTo.marker("2");
+verify.signatureHelpCountIs(2);
+verify.currentSignatureHelpIs("MainButton(buttonProps: ButtonProps): any");
+verify.currentParameterSpanIs("buttonProps: ButtonProps");
diff --git a/tests/lib/react.d.ts b/tests/lib/react.d.ts
index 0a3b0fdfabf9e..b2b0783cf1533 100644
--- a/tests/lib/react.d.ts
+++ b/tests/lib/react.d.ts
@@ -4,35 +4,51 @@
 // Definitions: https://github.com/borisyankov/DefinitelyTyped
 
 declare namespace __React {
+
     //
     // React Elements
     // ----------------------------------------------------------------------
 
     type ReactType = string | ComponentClass<any> | StatelessComponent<any>;
 
-    interface ReactElement<P extends Props<any>> {
-        type: string | ComponentClass<P> | StatelessComponent<P>;
+    type Key = string | number;
+    type Ref<T> = string | ((instance: T) => any);
+    type ComponentState = {} | void;
+
+    interface Attributes {
+        key?: Key;
+    }
+    interface ClassAttributes<T> extends Attributes {
+        ref?: Ref<T>;
+    }
+
+    interface ReactElement<P> {
+        type: string | ComponentClass<P> | SFC<P>;
         props: P;
-        key: string | number;
-        ref: string | ((component: Component<P, any> | Element) => any);
+        key?: Key;
+    }
+
+    interface SFCElement<P> extends ReactElement<P> {
+        type: SFC<P>;
     }
 
-    interface ClassicElement<P> extends ReactElement<P> {
-        type: ClassicComponentClass<P>;
-        ref: string | ((component: ClassicComponent<P, any>) => any);
+    type CElement<P, T extends Component<P, ComponentState>> = ComponentElement<P, T>;
+    interface ComponentElement<P, T extends Component<P, ComponentState>> extends ReactElement<P> {
+        type: ComponentClass<P>;
+        ref?: Ref<T>;
     }
 
-    interface DOMElement<P extends Props<Element>> extends ReactElement<P> {
+    type ClassicElement<P> = CElement<P, ClassicComponent<P, ComponentState>>;
+
+    interface DOMElement<P extends DOMAttributes<T>, T extends Element> extends ReactElement<P> {
         type: string;
-        ref: string | ((element: Element) => any);
+        ref: Ref<T>;
     }
 
-    interface ReactHTMLElement extends DOMElement<HTMLProps<HTMLElement>> {
-        ref: string | ((element: HTMLElement) => any);
+    interface ReactHTMLElement<T extends HTMLElement> extends DOMElement<HTMLAttributes<T>, T> {
     }
 
-    interface ReactSVGElement extends DOMElement<SVGProps> {
-        ref: string | ((element: SVGElement) => any);
+    interface ReactSVGElement extends DOMElement<SVGAttributes<SVGElement>, SVGElement> {
     }
 
     //
@@ -40,19 +56,29 @@ declare namespace __React {
     // ----------------------------------------------------------------------
 
     interface Factory<P> {
-        (props?: P, ...children: ReactNode[]): ReactElement<P>;
+        (props?: P & Attributes, ...children: ReactNode[]): ReactElement<P>;
     }
 
-    interface ClassicFactory<P> extends Factory<P> {
-        (props?: P, ...children: ReactNode[]): ClassicElement<P>;
+    interface SFCFactory<P> {
+        (props?: P & Attributes, ...children: ReactNode[]): SFCElement<P>;
     }
 
-    interface DOMFactory<P extends Props<Element>> extends Factory<P> {
-        (props?: P, ...children: ReactNode[]): DOMElement<P>;
+    interface ComponentFactory<P, T extends Component<P, ComponentState>> {
+        (props?: P & ClassAttributes<T>, ...children: ReactNode[]): CElement<P, T>;
     }
 
-    type HTMLFactory = DOMFactory<HTMLProps<HTMLElement>>;
-    type SVGFactory = DOMFactory<SVGProps>;
+    type CFactory<P, T extends Component<P, ComponentState>> = ComponentFactory<P, T>;
+    type ClassicFactory<P> = CFactory<P, ClassicComponent<P, ComponentState>>;
+
+    interface DOMFactory<P extends DOMAttributes<T>, T extends Element> {
+        (props?: P & ClassAttributes<T>, ...children: ReactNode[]): DOMElement<P, T>;
+    }
+
+    interface HTMLFactory<T extends HTMLElement> extends DOMFactory<HTMLAttributes<T>, T> {
+    }
+
+    interface SVGFactory extends DOMFactory<SVGAttributes<SVGElement>, SVGElement> {
+    }
 
     //
     // React Nodes
@@ -72,41 +98,59 @@ declare namespace __React {
 
     function createClass<P, S>(spec: ComponentSpec<P, S>): ClassicComponentClass<P>;
 
-    function createFactory<P>(type: string): DOMFactory<P>;
-    function createFactory<P>(type: ClassicComponentClass<P>): ClassicFactory<P>;
-    function createFactory<P>(type: ComponentClass<P> | StatelessComponent<P>): Factory<P>;
+    function createFactory<P extends DOMAttributes<T>, T extends Element>(
+        type: string): DOMFactory<P, T>;
+    function createFactory<P>(type: SFC<P>): SFCFactory<P>;
+    function createFactory<P>(
+        type: ClassType<P, ClassicComponent<P, ComponentState>, ClassicComponentClass<P>>): CFactory<P, ClassicComponent<P, ComponentState>>;
+    function createFactory<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>>(
+        type: ClassType<P, T, C>): CFactory<P, T>;
+    function createFactory<P>(type: ComponentClass<P> | SFC<P>): Factory<P>;
 
-    function createElement<P>(
+    function createElement<P extends DOMAttributes<T>, T extends Element>(
         type: string,
-        props?: P,
-        ...children: ReactNode[]): DOMElement<P>;
+        props?: P & ClassAttributes<T>,
+        ...children: ReactNode[]): DOMElement<P, T>;
     function createElement<P>(
-        type: ClassicComponentClass<P>,
-        props?: P,
-        ...children: ReactNode[]): ClassicElement<P>;
+        type: SFC<P>,
+        props?: P & Attributes,
+        ...children: ReactNode[]): SFCElement<P>;
     function createElement<P>(
-        type: ComponentClass<P> | StatelessComponent<P>,
-        props?: P,
+        type: ClassType<P, ClassicComponent<P, ComponentState>, ClassicComponentClass<P>>,
+        props?: P & ClassAttributes<ClassicComponent<P, ComponentState>>,
+        ...children: ReactNode[]): CElement<P, ClassicComponent<P, ComponentState>>;
+    function createElement<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>>(
+        type: ClassType<P, T, C>,
+        props?: P & ClassAttributes<T>,
+        ...children: ReactNode[]): CElement<P, T>;
+    function createElement<P>(
+        type: ComponentClass<P> | SFC<P>,
+        props?: P & Attributes,
         ...children: ReactNode[]): ReactElement<P>;
 
-    function cloneElement<P>(
-        element: DOMElement<P>,
-        props?: P,
-        ...children: ReactNode[]): DOMElement<P>;
-    function cloneElement<P>(
-        element: ClassicElement<P>,
-        props?: P,
-        ...children: ReactNode[]): ClassicElement<P>;
-    function cloneElement<P>(
+    function cloneElement<P extends DOMAttributes<T>, T extends Element>(
+        element: DOMElement<P, T>,
+        props?: P & ClassAttributes<T>,
+        ...children: ReactNode[]): DOMElement<P, T>;
+    function cloneElement<P extends Q, Q>(
+        element: SFCElement<P>,
+        props?: Q, // should be Q & Attributes, but then Q is inferred as {}
+        ...children: ReactNode[]): SFCElement<P>;
+    function cloneElement<P extends Q, Q, T extends Component<P, ComponentState>>(
+        element: CElement<P, T>,
+        props?: Q, // should be Q & ClassAttributes<T>
+        ...children: ReactNode[]): CElement<P, T>;
+    function cloneElement<P extends Q, Q>(
         element: ReactElement<P>,
-        props?: P,
+        props?: Q, // should be Q & Attributes
         ...children: ReactNode[]): ReactElement<P>;
 
-    function isValidElement(object: {}): boolean;
+    function isValidElement<P>(object: {}): object is ReactElement<P>;
 
     var DOM: ReactDOM;
     var PropTypes: ReactPropTypes;
     var Children: ReactChildren;
+    var version: string;
 
     //
     // Component API
@@ -120,8 +164,14 @@ declare namespace __React {
         setState(f: (prevState: S, props: P) => S, callback?: () => any): void;
         setState(state: S, callback?: () => any): void;
         forceUpdate(callBack?: () => any): void;
-        render(): JSX.Element;
-        props: P;
+        render(): JSX.Element | null;
+
+        // React.Props<T> is now deprecated, which means that the `children`
+        // property is not available on `P` by default, even though you can
+        // always pass children as variadic arguments to `createElement`.
+        // In the future, if we can define its call signature conditionally
+        // on the existence of `children` in `P`, then we should remove this.
+        props: P & { children?: ReactNode };
         state: S;
         context: {};
         refs: {
@@ -129,6 +179,8 @@ declare namespace __React {
         };
     }
 
+    class PureComponent<P, S> extends Component<P, S> {}
+
     interface ClassicComponent<P, S> extends Component<P, S> {
         replaceState(nextState: S, callback?: () => any): void;
         isMounted(): boolean;
@@ -143,27 +195,39 @@ declare namespace __React {
     // Class Interfaces
     // ----------------------------------------------------------------------
 
+    type SFC<P> = StatelessComponent<P>;
     interface StatelessComponent<P> {
-        (props?: P, context?: any): ReactElement<any>;
+        (props: P, context?: any): ReactElement<any>;
         propTypes?: ValidationMap<P>;
         contextTypes?: ValidationMap<any>;
         defaultProps?: P;
+        displayName?: string;
     }
 
     interface ComponentClass<P> {
-        new(props?: P, context?: any): Component<P, any>;
+        new(props?: P, context?: any): Component<P, ComponentState>;
         propTypes?: ValidationMap<P>;
         contextTypes?: ValidationMap<any>;
         childContextTypes?: ValidationMap<any>;
         defaultProps?: P;
+        displayName?: string;
     }
 
     interface ClassicComponentClass<P> extends ComponentClass<P> {
-        new(props?: P, context?: any): ClassicComponent<P, any>;
+        new(props?: P, context?: any): ClassicComponent<P, ComponentState>;
         getDefaultProps?(): P;
-        displayName?: string;
     }
 
+    /**
+     * We use an intersection type to infer multiple type parameters from
+     * a single argument, which is useful for many top-level API defs.
+     * See https://github.com/Microsoft/TypeScript/issues/7234 for more info.
+     */
+    type ClassType<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>> =
+        C &
+        (new() => T) &
+        (new() => { props: P });
+
     //
     // Component Specs and Lifecycle
     // ----------------------------------------------------------------------
@@ -187,7 +251,7 @@ declare namespace __React {
         displayName?: string;
         propTypes?: ValidationMap<any>;
         contextTypes?: ValidationMap<any>;
-        childContextTypes?: ValidationMap<any>
+        childContextTypes?: ValidationMap<any>;
 
         getDefaultProps?(): P;
         getInitialState?(): S;
@@ -203,41 +267,44 @@ declare namespace __React {
     // Event System
     // ----------------------------------------------------------------------
 
-    interface SyntheticEvent {
+    interface SyntheticEvent<T> {
         bubbles: boolean;
+        currentTarget: EventTarget & T;
         cancelable: boolean;
-        currentTarget: EventTarget;
         defaultPrevented: boolean;
         eventPhase: number;
         isTrusted: boolean;
         nativeEvent: Event;
         preventDefault(): void;
+        isDefaultPrevented(): boolean;
         stopPropagation(): void;
+        isPropagationStopped(): boolean;
+        persist(): void;
         target: EventTarget;
         timeStamp: Date;
         type: string;
     }
 
-    interface ClipboardEvent extends SyntheticEvent {
+    interface ClipboardEvent<T> extends SyntheticEvent<T> {
         clipboardData: DataTransfer;
     }
 
-    interface CompositionEvent extends SyntheticEvent {
+    interface CompositionEvent<T> extends SyntheticEvent<T> {
         data: string;
     }
 
-    interface DragEvent extends SyntheticEvent {
+    interface DragEvent<T> extends MouseEvent<T> {
         dataTransfer: DataTransfer;
     }
 
-    interface FocusEvent extends SyntheticEvent {
+    interface FocusEvent<T> extends SyntheticEvent<T> {
         relatedTarget: EventTarget;
     }
 
-    interface FormEvent extends SyntheticEvent {
+    interface FormEvent<T> extends SyntheticEvent<T> {
     }
 
-    interface KeyboardEvent extends SyntheticEvent {
+    interface KeyboardEvent<T> extends SyntheticEvent<T> {
         altKey: boolean;
         charCode: number;
         ctrlKey: boolean;
@@ -252,7 +319,7 @@ declare namespace __React {
         which: number;
     }
 
-    interface MouseEvent extends SyntheticEvent {
+    interface MouseEvent<T> extends SyntheticEvent<T> {
         altKey: boolean;
         button: number;
         buttons: number;
@@ -269,7 +336,7 @@ declare namespace __React {
         shiftKey: boolean;
     }
 
-    interface TouchEvent extends SyntheticEvent {
+    interface TouchEvent<T> extends SyntheticEvent<T> {
         altKey: boolean;
         changedTouches: TouchList;
         ctrlKey: boolean;
@@ -280,178 +347,1577 @@ declare namespace __React {
         touches: TouchList;
     }
 
-    interface UIEvent extends SyntheticEvent {
+    interface UIEvent<T> extends SyntheticEvent<T> {
         detail: number;
         view: AbstractView;
     }
 
-    interface WheelEvent extends SyntheticEvent {
+    interface WheelEvent<T> extends MouseEvent<T> {
         deltaMode: number;
         deltaX: number;
         deltaY: number;
         deltaZ: number;
     }
 
+    interface AnimationEvent extends SyntheticEvent<{}> {
+        animationName: string;
+        pseudoElement: string;
+        elapsedTime: number;
+    }
+
+    interface TransitionEvent extends SyntheticEvent<{}> {
+        propertyName: string;
+        pseudoElement: string;
+        elapsedTime: number;
+    }
+
     //
     // Event Handler Types
     // ----------------------------------------------------------------------
 
-    interface EventHandler<E extends SyntheticEvent> {
+    interface EventHandler<E extends SyntheticEvent<any>> {
         (event: E): void;
     }
 
-    type ReactEventHandler = EventHandler<SyntheticEvent>;
-
-    type ClipboardEventHandler = EventHandler<ClipboardEvent>;
-    type CompositionEventHandler = EventHandler<CompositionEvent>;
-    type DragEventHandler = EventHandler<DragEvent>;
-    type FocusEventHandler = EventHandler<FocusEvent>;
-    type FormEventHandler = EventHandler<FormEvent>;
-    type KeyboardEventHandler = EventHandler<KeyboardEvent>;
-    type MouseEventHandler = EventHandler<MouseEvent>;
-    type TouchEventHandler = EventHandler<TouchEvent>;
-    type UIEventHandler = EventHandler<UIEvent>;
-    type WheelEventHandler = EventHandler<WheelEvent>;
+    type ReactEventHandler<T> = EventHandler<SyntheticEvent<T>>;
+
+    type ClipboardEventHandler<T> = EventHandler<ClipboardEvent<T>>;
+    type CompositionEventHandler<T> = EventHandler<CompositionEvent<T>>;
+    type DragEventHandler<T> = EventHandler<DragEvent<T>>;
+    type FocusEventHandler<T> = EventHandler<FocusEvent<T>>;
+    type FormEventHandler<T> = EventHandler<FormEvent<T>>;
+    type KeyboardEventHandler<T> = EventHandler<KeyboardEvent<T>>;
+    type MouseEventHandler<T> = EventHandler<MouseEvent<T>>;
+    type TouchEventHandler<T> = EventHandler<TouchEvent<T>>;
+    type UIEventHandler<T> = EventHandler<UIEvent<T>>;
+    type WheelEventHandler<T> = EventHandler<WheelEvent<T>>;
+    type AnimationEventHandler = EventHandler<AnimationEvent>;
+    type TransitionEventHandler = EventHandler<TransitionEvent>;
 
     //
     // Props / DOM Attributes
     // ----------------------------------------------------------------------
 
+    /**
+     * @deprecated. This was used to allow clients to pass `ref` and `key`
+     * to `createElement`, which is no longer necessary due to intersection
+     * types. If you need to declare a props object before passing it to
+     * `createElement` or a factory, use `ClassAttributes<T>`:
+     *
+     * ```ts
+     * var b: Button;
+     * var props: ButtonProps & ClassAttributes<Button> = {
+     *     ref: b => button = b, // ok!
+     *     label: "I'm a Button"
+     * };
+     * ```
+     */
     interface Props<T> {
         children?: ReactNode;
-        key?: string | number;
-        ref?: string | ((component: T) => any);
+        key?: Key;
+        ref?: Ref<T>;
     }
 
-    interface HTMLProps<T> extends HTMLAttributes, Props<T> {
+    interface HTMLProps<T> extends HTMLAttributes<T>, ClassAttributes<T> {
     }
 
-    interface SVGProps extends SVGAttributes, Props<SVGElement> {
+    interface SVGProps extends SVGAttributes<SVGElement>, ClassAttributes<SVGElement> {
     }
 
-    interface DOMAttributes {
+    interface DOMAttributes<T> {
+        children?: ReactNode;
         dangerouslySetInnerHTML?: {
             __html: string;
         };
 
         // Clipboard Events
-        onCopy?: ClipboardEventHandler;
-        onCut?: ClipboardEventHandler;
-        onPaste?: ClipboardEventHandler;
+        onCopy?: ClipboardEventHandler<T>;
+        onCut?: ClipboardEventHandler<T>;
+        onPaste?: ClipboardEventHandler<T>;
 
         // Composition Events
-        onCompositionEnd?: CompositionEventHandler;
-        onCompositionStart?: CompositionEventHandler;
-        onCompositionUpdate?: CompositionEventHandler;
+        onCompositionEnd?: CompositionEventHandler<T>;
+        onCompositionStart?: CompositionEventHandler<T>;
+        onCompositionUpdate?: CompositionEventHandler<T>;
 
         // Focus Events
-        onFocus?: FocusEventHandler;
-        onBlur?: FocusEventHandler;
+        onFocus?: FocusEventHandler<T>;
+        onBlur?: FocusEventHandler<T>;
 
         // Form Events
-        onChange?: FormEventHandler;
-        onInput?: FormEventHandler;
-        onSubmit?: FormEventHandler;
+        onChange?: FormEventHandler<T>;
+        onInput?: FormEventHandler<T>;
+        onSubmit?: FormEventHandler<T>;
 
         // Image Events
-        onLoad?: ReactEventHandler;
-        onError?: ReactEventHandler; // also a Media Event
+        onLoad?: ReactEventHandler<T>;
+        onError?: ReactEventHandler<T>; // also a Media Event
 
         // Keyboard Events
-        onKeyDown?: KeyboardEventHandler;
-        onKeyPress?: KeyboardEventHandler;
-        onKeyUp?: KeyboardEventHandler;
+        onKeyDown?: KeyboardEventHandler<T>;
+        onKeyPress?: KeyboardEventHandler<T>;
+        onKeyUp?: KeyboardEventHandler<T>;
 
         // Media Events
-        onAbort?: ReactEventHandler;
-        onCanPlay?: ReactEventHandler;
-        onCanPlayThrough?: ReactEventHandler;
-        onDurationChange?: ReactEventHandler;
-        onEmptied?: ReactEventHandler;
-        onEncrypted?: ReactEventHandler;
-        onEnded?: ReactEventHandler;
-        onLoadedData?: ReactEventHandler;
-        onLoadedMetadata?: ReactEventHandler;
-        onLoadStart?: ReactEventHandler;
-        onPause?: ReactEventHandler;
-        onPlay?: ReactEventHandler;
-        onPlaying?: ReactEventHandler;
-        onProgress?: ReactEventHandler;
-        onRateChange?: ReactEventHandler;
-        onSeeked?: ReactEventHandler;
-        onSeeking?: ReactEventHandler;
-        onStalled?: ReactEventHandler;
-        onSuspend?: ReactEventHandler;
-        onTimeUpdate?: ReactEventHandler;
-        onVolumeChange?: ReactEventHandler;
-        onWaiting?: ReactEventHandler;
+        onAbort?: ReactEventHandler<T>;
+        onCanPlay?: ReactEventHandler<T>;
+        onCanPlayThrough?: ReactEventHandler<T>;
+        onDurationChange?: ReactEventHandler<T>;
+        onEmptied?: ReactEventHandler<T>;
+        onEncrypted?: ReactEventHandler<T>;
+        onEnded?: ReactEventHandler<T>;
+        onLoadedData?: ReactEventHandler<T>;
+        onLoadedMetadata?: ReactEventHandler<T>;
+        onLoadStart?: ReactEventHandler<T>;
+        onPause?: ReactEventHandler<T>;
+        onPlay?: ReactEventHandler<T>;
+        onPlaying?: ReactEventHandler<T>;
+        onProgress?: ReactEventHandler<T>;
+        onRateChange?: ReactEventHandler<T>;
+        onSeeked?: ReactEventHandler<T>;
+        onSeeking?: ReactEventHandler<T>;
+        onStalled?: ReactEventHandler<T>;
+        onSuspend?: ReactEventHandler<T>;
+        onTimeUpdate?: ReactEventHandler<T>;
+        onVolumeChange?: ReactEventHandler<T>;
+        onWaiting?: ReactEventHandler<T>;
 
         // MouseEvents
-        onClick?: MouseEventHandler;
-        onContextMenu?: MouseEventHandler;
-        onDoubleClick?: MouseEventHandler;
-        onDrag?: DragEventHandler;
-        onDragEnd?: DragEventHandler;
-        onDragEnter?: DragEventHandler;
-        onDragExit?: DragEventHandler;
-        onDragLeave?: DragEventHandler;
-        onDragOver?: DragEventHandler;
-        onDragStart?: DragEventHandler;
-        onDrop?: DragEventHandler;
-        onMouseDown?: MouseEventHandler;
-        onMouseEnter?: MouseEventHandler;
-        onMouseLeave?: MouseEventHandler;
-        onMouseMove?: MouseEventHandler;
-        onMouseOut?: MouseEventHandler;
-        onMouseOver?: MouseEventHandler;
-        onMouseUp?: MouseEventHandler;
+        onClick?: MouseEventHandler<T>;
+        onContextMenu?: MouseEventHandler<T>;
+        onDoubleClick?: MouseEventHandler<T>;
+        onDrag?: DragEventHandler<T>;
+        onDragEnd?: DragEventHandler<T>;
+        onDragEnter?: DragEventHandler<T>;
+        onDragExit?: DragEventHandler<T>;
+        onDragLeave?: DragEventHandler<T>;
+        onDragOver?: DragEventHandler<T>;
+        onDragStart?: DragEventHandler<T>;
+        onDrop?: DragEventHandler<T>;
+        onMouseDown?: MouseEventHandler<T>;
+        onMouseEnter?: MouseEventHandler<T>;
+        onMouseLeave?: MouseEventHandler<T>;
+        onMouseMove?: MouseEventHandler<T>;
+        onMouseOut?: MouseEventHandler<T>;
+        onMouseOver?: MouseEventHandler<T>;
+        onMouseUp?: MouseEventHandler<T>;
 
         // Selection Events
-        onSelect?: ReactEventHandler;
+        onSelect?: ReactEventHandler<T>;
 
         // Touch Events
-        onTouchCancel?: TouchEventHandler;
-        onTouchEnd?: TouchEventHandler;
-        onTouchMove?: TouchEventHandler;
-        onTouchStart?: TouchEventHandler;
+        onTouchCancel?: TouchEventHandler<T>;
+        onTouchEnd?: TouchEventHandler<T>;
+        onTouchMove?: TouchEventHandler<T>;
+        onTouchStart?: TouchEventHandler<T>;
 
         // UI Events
-        onScroll?: UIEventHandler;
+        onScroll?: UIEventHandler<T>;
 
         // Wheel Events
-        onWheel?: WheelEventHandler;
+        onWheel?: WheelEventHandler<T>;
+
+        // Animation Events
+        onAnimationStart?: AnimationEventHandler;
+        onAnimationEnd?: AnimationEventHandler;
+        onAnimationIteration?: AnimationEventHandler;
+
+        // Transition Events
+        onTransitionEnd?: TransitionEventHandler;
     }
 
     // This interface is not complete. Only properties accepting
     // unitless numbers are listed here (see CSSProperty.js in React)
     interface CSSProperties {
+
+        /**
+         * Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis.
+         */
+        alignContent?: any;
+
+        /**
+         * Sets the default alignment in the cross axis for all of the flex container's items, including anonymous flex items, similarly to how justify-content aligns items along the main axis.
+         */
+        alignItems?: any;
+
+        /**
+         * Allows the default alignment to be overridden for individual flex items.
+         */
+        alignSelf?: any;
+
+        /**
+         * This property allows precise alignment of elements, such as graphics, that do not have a baseline-table or lack the desired baseline in their baseline-table. With the alignment-adjust property, the position of the baseline identified by the alignment-baseline can be explicitly determined. It also determines precisely the alignment point for each glyph within a textual element.
+         */
+        alignmentAdjust?: any;
+
+        alignmentBaseline?: any;
+
+        /**
+         * Defines a length of time to elapse before an animation starts, allowing an animation to begin execution some time after it is applied.
+         */
+        animationDelay?: any;
+
+        /**
+         * Defines whether an animation should run in reverse on some or all cycles.
+         */
+        animationDirection?: any;
+
+        /**
+         * Specifies how many times an animation cycle should play.
+         */
+        animationIterationCount?: any;
+
+        /**
+         * Defines the list of animations that apply to the element.
+         */
+        animationName?: any;
+
+        /**
+         * Defines whether an animation is running or paused.
+         */
+        animationPlayState?: any;
+
+        /**
+         * Allows changing the style of any element to platform-based interface elements or vice versa.
+         */
+        appearance?: any;
+
+        /**
+         * Determines whether or not the “back” side of a transformed element is visible when facing the viewer.
+         */
+        backfaceVisibility?: any;
+
+        /**
+         * Shorthand property to set the values for one or more of:
+         * background-clip, background-color, background-image,
+         * background-origin, background-position, background-repeat,
+         * background-size, and background-attachment.
+         */
+        background?: any;
+
+        /**
+         * If a background-image is specified, this property determines
+         * whether that image's position is fixed within the viewport,
+         * or scrolls along with its containing block.
+         */
+        backgroundAttachment?: "scroll" | "fixed" | "local";
+
+        /**
+         * This property describes how the element's background images should blend with each other and the element's background color.
+         * The value is a list of blend modes that corresponds to each background image. Each element in the list will apply to the corresponding element of background-image. If a property doesn’t have enough comma-separated values to match the number of layers, the UA must calculate its used value by repeating the list of values until there are enough.
+         */
+        backgroundBlendMode?: any;
+
+        /**
+         * Sets the background color of an element.
+         */
+        backgroundColor?: any;
+
+        backgroundComposite?: any;
+
+        /**
+         * Applies one or more background images to an element. These can be any valid CSS image, including url() paths to image files or CSS gradients.
+         */
+        backgroundImage?: any;
+
+        /**
+         * Specifies what the background-position property is relative to.
+         */
+        backgroundOrigin?: any;
+
+        /**
+         * Sets the position of a background image.
+         */
+        backgroundPosition?: any;
+
+        /**
+         * Background-repeat defines if and how background images will be repeated after they have been sized and positioned
+         */
+        backgroundRepeat?: any;
+
+        /**
+         * Obsolete - spec retired, not implemented.
+         */
+        baselineShift?: any;
+
+        /**
+         * Non standard. Sets or retrieves the location of the Dynamic HTML (DHTML) behavior.
+         */
+        behavior?: any;
+
+        /**
+         * Shorthand property that defines the different properties of all four sides of an element's border in a single declaration. It can be used to set border-width, border-style and border-color, or a subset of these.
+         */
+        border?: any;
+
+        /**
+         * Shorthand that sets the values of border-bottom-color,
+         * border-bottom-style, and border-bottom-width.
+         */
+        borderBottom?: any;
+
+        /**
+         * Sets the color of the bottom border of an element.
+         */
+        borderBottomColor?: any;
+
+        /**
+         * Defines the shape of the border of the bottom-left corner.
+         */
+        borderBottomLeftRadius?: any;
+
+        /**
+         * Defines the shape of the border of the bottom-right corner.
+         */
+        borderBottomRightRadius?: any;
+
+        /**
+         * Sets the line style of the bottom border of a box.
+         */
+        borderBottomStyle?: any;
+
+        /**
+         * Sets the width of an element's bottom border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width.
+         */
+        borderBottomWidth?: any;
+
+        /**
+         * Border-collapse can be used for collapsing the borders between table cells
+         */
+        borderCollapse?: any;
+
+        /**
+         * The CSS border-color property sets the color of an element's four borders. This property can have from one to four values, made up of the elementary properties:     •       border-top-color
+         *      •       border-right-color
+         *      •       border-bottom-color
+         *      •       border-left-color The default color is the currentColor of each of these values.
+         * If you provide one value, it sets the color for the element. Two values set the horizontal and vertical values, respectively. Providing three values sets the top, vertical, and bottom values, in that order. Four values set all for sides: top, right, bottom, and left, in that order.
+         */
+        borderColor?: any;
+
+        /**
+         * Specifies different corner clipping effects, such as scoop (inner curves), bevel (straight cuts) or notch (cut-off rectangles). Works along with border-radius to specify the size of each corner effect.
+         */
+        borderCornerShape?: any;
+
+        /**
+         * The property border-image-source is used to set the image to be used instead of the border style. If this is set to none the border-style is used instead.
+         */
+        borderImageSource?: any;
+
+        /**
+         * The border-image-width CSS property defines the offset to use for dividing the border image in nine parts, the top-left corner, central top edge, top-right-corner, central right edge, bottom-right corner, central bottom edge, bottom-left corner, and central right edge. They represent inward distance from the top, right, bottom, and left edges.
+         */
+        borderImageWidth?: any;
+
+        /**
+         * Shorthand property that defines the border-width, border-style and border-color of an element's left border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the left border — border-left-width, border-left-style and border-left-color.
+         */
+        borderLeft?: any;
+
+        /**
+         * The CSS border-left-color property sets the color of an element's left border. This page explains the border-left-color value, but often you will find it more convenient to fix the border's left color as part of a shorthand set, either border-left or border-color.
+         * Colors can be defined several ways. For more information, see Usage.
+         */
+        borderLeftColor?: any;
+
+        /**
+         * Sets the style of an element's left border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style.
+         */
+        borderLeftStyle?: any;
+
+        /**
+         * Sets the width of an element's left border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width.
+         */
+        borderLeftWidth?: any;
+
+        /**
+         * Shorthand property that defines the border-width, border-style and border-color of an element's right border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the right border — border-right-width, border-right-style and border-right-color.
+         */
+        borderRight?: any;
+
+        /**
+         * Sets the color of an element's right border. This page explains the border-right-color value, but often you will find it more convenient to fix the border's right color as part of a shorthand set, either border-right or border-color.
+         * Colors can be defined several ways. For more information, see Usage.
+         */
+        borderRightColor?: any;
+
+        /**
+         * Sets the style of an element's right border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style.
+         */
+        borderRightStyle?: any;
+
+        /**
+         * Sets the width of an element's right border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width.
+         */
+        borderRightWidth?: any;
+
+        /**
+         * Specifies the distance between the borders of adjacent cells.
+         */
+        borderSpacing?: any;
+
+        /**
+         * Sets the style of an element's four borders. This property can have from one to four values. With only one value, the value will be applied to all four borders; otherwise, this works as a shorthand property for each of border-top-style, border-right-style, border-bottom-style, border-left-style, where each border style may be assigned a separate value.
+         */
+        borderStyle?: any;
+
+        /**
+         * Shorthand property that defines the border-width, border-style and border-color of an element's top border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the top border — border-top-width, border-top-style and border-top-color.
+         */
+        borderTop?: any;
+
+        /**
+         * Sets the color of an element's top border. This page explains the border-top-color value, but often you will find it more convenient to fix the border's top color as part of a shorthand set, either border-top or border-color.
+         * Colors can be defined several ways. For more information, see Usage.
+         */
+        borderTopColor?: any;
+
+        /**
+         * Sets the rounding of the top-left corner of the element.
+         */
+        borderTopLeftRadius?: any;
+
+        /**
+         * Sets the rounding of the top-right corner of the element.
+         */
+        borderTopRightRadius?: any;
+
+        /**
+         * Sets the style of an element's top border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style.
+         */
+        borderTopStyle?: any;
+
+        /**
+         * Sets the width of an element's top border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width.
+         */
+        borderTopWidth?: any;
+
+        /**
+         * Sets the width of an element's four borders. This property can have from one to four values. This is a shorthand property for setting values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width.
+         */
+        borderWidth?: any;
+
+        /**
+         * This property specifies how far an absolutely positioned box's bottom margin edge is offset above the bottom edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the bottom edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties).
+         */
+        bottom?: any;
+
+        /**
+         * Obsolete.
+         */
+        boxAlign?: any;
+
+        /**
+         * Breaks a box into fragments creating new borders, padding and repeating backgrounds or lets it stay as a continuous box on a page break, column break, or, for inline elements, at a line break.
+         */
+        boxDecorationBreak?: any;
+
+        /**
+         * Deprecated
+         */
+        boxDirection?: any;
+
+        /**
+         * Do not use. This property has been replaced by the flex-wrap property.
+         * Gets or sets a value that specifies the direction to add successive rows or columns when the value of box-lines is set to multiple.
+         */
+        boxLineProgression?: any;
+
+        /**
+         * Do not use. This property has been replaced by the flex-wrap property.
+         * Gets or sets a value that specifies whether child elements wrap onto multiple lines or columns based on the space available in the object.
+         */
+        boxLines?: any;
+
+        /**
+         * Do not use. This property has been replaced by flex-order.
+         * Specifies the ordinal group that a child element of the object belongs to. This ordinal value identifies the display order (along the axis defined by the box-orient property) for the group.
+         */
+        boxOrdinalGroup?: any;
+
+        /**
+         * Deprecated.
+         */
         boxFlex?: number;
+
+        /**
+         * Deprecated.
+         */
         boxFlexGroup?: number;
+
+        /**
+         * The CSS break-after property allows you to force a break on multi-column layouts. More specifically, it allows you to force a break after an element. It allows you to determine if a break should occur, and what type of break it should be. The break-after CSS property describes how the page, column or region break behaves after the generated box. If there is no generated box, the property is ignored.
+         */
+        breakAfter?: any;
+
+        /**
+         * Control page/column/region breaks that fall above a block of content
+         */
+        breakBefore?: any;
+
+        /**
+         * Control page/column/region breaks that fall within a block of content
+         */
+        breakInside?: any;
+
+        /**
+         * The clear CSS property specifies if an element can be positioned next to or must be positioned below the floating elements that precede it in the markup.
+         */
+        clear?: any;
+
+        /**
+         * Deprecated; see clip-path.
+         * Lets you specify the dimensions of an absolutely positioned element that should be visible, and the element is clipped into this shape, and displayed.
+         */
+        clip?: any;
+
+        /**
+         * Clipping crops an graphic, so that only a portion of the graphic is rendered, or filled. This clip-rule property, when used with the clip-path property, defines which clip rule, or algorithm, to use when filling the different parts of a graphics.
+         */
+        clipRule?: any;
+
+        /**
+         * The color property sets the color of an element's foreground content (usually text), accepting any standard CSS color from keywords and hex values to RGB(a) and HSL(a).
+         */
+        color?: any;
+
+        /**
+         * Describes the number of columns of the element.
+         */
         columnCount?: number;
+
+        /**
+         * Specifies how to fill columns (balanced or sequential).
+         */
+        columnFill?: any;
+
+        /**
+         * The column-gap property controls the width of the gap between columns in multi-column elements.
+         */
+        columnGap?: any;
+
+        /**
+         * Sets the width, style, and color of the rule between columns.
+         */
+        columnRule?: any;
+
+        /**
+         * Specifies the color of the rule between columns.
+         */
+        columnRuleColor?: any;
+
+        /**
+         * Specifies the width of the rule between columns.
+         */
+        columnRuleWidth?: any;
+
+        /**
+         * The column-span CSS property makes it possible for an element to span across all columns when its value is set to all. An element that spans more than one column is called a spanning element.
+         */
+        columnSpan?: any;
+
+        /**
+         * Specifies the width of columns in multi-column elements.
+         */
+        columnWidth?: any;
+
+        /**
+         * This property is a shorthand property for setting column-width and/or column-count.
+         */
+        columns?: any;
+
+        /**
+         * The counter-increment property accepts one or more names of counters (identifiers), each one optionally followed by an integer which specifies the value by which the counter should be incremented (e.g. if the value is 2, the counter increases by 2 each time it is invoked).
+         */
+        counterIncrement?: any;
+
+        /**
+         * The counter-reset property contains a list of one or more names of counters, each one optionally followed by an integer (otherwise, the integer defaults to 0.) Each time the given element is invoked, the counters specified by the property are set to the given integer.
+         */
+        counterReset?: any;
+
+        /**
+         * The cue property specifies sound files (known as an "auditory icon") to be played by speech media agents before and after presenting an element's content; if only one file is specified, it is played both before and after. The volume at which the file(s) should be played, relative to the volume of the main element, may also be specified. The icon files may also be set separately with the cue-before and cue-after properties.
+         */
+        cue?: any;
+
+        /**
+         * The cue-after property specifies a sound file (known as an "auditory icon") to be played by speech media agents after presenting an element's content; the volume at which the file should be played may also be specified. The shorthand property cue sets cue sounds for both before and after the element is presented.
+         */
+        cueAfter?: any;
+
+        /**
+         * Specifies the mouse cursor displayed when the mouse pointer is over an element.
+         */
+        cursor?: any;
+
+        /**
+         * The direction CSS property specifies the text direction/writing direction. The rtl is used for Hebrew or Arabic text, the ltr is for other languages.
+         */
+        direction?: any;
+
+        /**
+         * This property specifies the type of rendering box used for an element. It is a shorthand property for many other display properties.
+         */
+        display?: any;
+
+        /**
+         * The ‘fill’ property paints the interior of the given graphical element. The area to be painted consists of any areas inside the outline of the shape. To determine the inside of the shape, all subpaths are considered, and the interior is determined according to the rules associated with the current value of the ‘fill-rule’ property. The zero-width geometric outline of a shape is included in the area to be painted.
+         */
+        fill?: any;
+
+        /**
+         * SVG: Specifies the opacity of the color or the content the current object is filled with.
+         */
+        fillOpacity?: number;
+
+        /**
+         * The ‘fill-rule’ property indicates the algorithm which is to be used to determine what parts of the canvas are included inside the shape. For a simple, non-intersecting path, it is intuitively clear what region lies "inside"; however, for a more complex path, such as a path that intersects itself or where one subpath encloses another, the interpretation of "inside" is not so obvious.
+         * The ‘fill-rule’ property provides two options for how the inside of a shape is determined:
+         */
+        fillRule?: any;
+
+        /**
+         * Applies various image processing effects. This property is largely unsupported. See Compatibility section for more information.
+         */
+        filter?: any;
+
+        /**
+         * Shorthand for `flex-grow`, `flex-shrink`, and `flex-basis`.
+         */
         flex?: number | string;
+
+        /**
+         * Obsolete, do not use. This property has been renamed to align-items.
+         * Specifies the alignment (perpendicular to the layout axis defined by the flex-direction property) of child elements of the object.
+         */
+        flexAlign?: any;
+
+        /**
+         * The flex-basis CSS property describes the initial main size of the flex item before any free space is distributed according to the flex factors described in the flex property (flex-grow and flex-shrink).
+         */
+        flexBasis?: any;
+
+        /**
+         * The flex-direction CSS property describes how flex items are placed in the flex container, by setting the direction of the flex container's main axis.
+         */
+        flexDirection?: any;
+
+        /**
+         * The flex-flow CSS property defines the flex container's main and cross axis. It is a shorthand property for the flex-direction and flex-wrap properties.
+         */
+        flexFlow?: any;
+
+        /**
+         * Specifies the flex grow factor of a flex item.
+         */
         flexGrow?: number;
+
+        /**
+         * Do not use. This property has been renamed to align-self
+         * Specifies the alignment (perpendicular to the layout axis defined by flex-direction) of child elements of the object.
+         */
+        flexItemAlign?: any;
+
+        /**
+         * Do not use. This property has been renamed to align-content.
+         * Specifies how a flexbox's lines align within the flexbox when there is extra space along the axis that is perpendicular to the axis defined by the flex-direction property.
+         */
+        flexLinePack?: any;
+
+        /**
+         * Gets or sets a value that specifies the ordinal group that a flexbox element belongs to. This ordinal value identifies the display order for the group.
+         */
+        flexOrder?: any;
+
+        /**
+         * Specifies the flex shrink factor of a flex item.
+         */
         flexShrink?: number;
-        fontWeight?: number | string;
+
+        /**
+         * Elements which have the style float are floated horizontally. These elements can move as far to the left or right of the containing element. All elements after the floating element will flow around it, but elements before the floating element are not impacted. If several floating elements are placed after each other, they will float next to each other as long as there is room.
+         */
+        float?: any;
+
+        /**
+         * Flows content from a named flow (specified by a corresponding flow-into) through selected elements to form a dynamic chain of layout regions.
+         */
+        flowFrom?: any;
+
+        /**
+         * The font property is shorthand that allows you to do one of two things: you can either set up six of the most mature font properties in one line, or you can set one of a choice of keywords to adopt a system font setting.
+         */
+        font?: any;
+
+        /**
+         * The font-family property allows one or more font family names and/or generic family names to be specified for usage on the selected element(s)' text. The browser then goes through the list; for each character in the selection it applies the first font family that has an available glyph for that character.
+         */
+        fontFamily?: any;
+
+        /**
+         * The font-kerning property allows contextual adjustment of inter-glyph spacing, i.e. the spaces between the characters in text. This property controls <bold>metric kerning</bold> - that utilizes adjustment data contained in the font. Optical Kerning is not supported as yet.
+         */
+        fontKerning?: any;
+
+        /**
+         * Specifies the size of the font. Used to compute em and ex units.
+         */
+        fontSize?: number | string;
+
+        /**
+         * The font-size-adjust property adjusts the font-size of the fallback fonts defined with font-family, so that the x-height is the same no matter what font is used. This preserves the readability of the text when fallback happens.
+         */
+        fontSizeAdjust?: any;
+
+        /**
+         * Allows you to expand or condense the widths for a normal, condensed, or expanded font face.
+         */
+        fontStretch?: any;
+
+        /**
+         * The font-style property allows normal, italic, or oblique faces to be selected. Italic forms are generally cursive in nature while oblique faces are typically sloped versions of the regular face. Oblique faces can be simulated by artificially sloping the glyphs of the regular face.
+         */
+        fontStyle?: any;
+
+        /**
+         * This value specifies whether the user agent is allowed to synthesize bold or oblique font faces when a font family lacks bold or italic faces.
+         */
+        fontSynthesis?: any;
+
+        /**
+         * The font-variant property enables you to select the small-caps font within a font family.
+         */
+        fontVariant?: any;
+
+        /**
+         * Fonts can provide alternate glyphs in addition to default glyph for a character. This property provides control over the selection of these alternate glyphs.
+         */
+        fontVariantAlternates?: any;
+
+        /**
+         * Specifies the weight or boldness of the font.
+         */
+        fontWeight?: "normal" | "bold" | "lighter" | "bolder" | number;
+
+        /**
+         * Lays out one or more grid items bound by 4 grid lines. Shorthand for setting grid-column-start, grid-column-end, grid-row-start, and grid-row-end in a single declaration.
+         */
+        gridArea?: any;
+
+        /**
+         * Controls a grid item's placement in a grid area, particularly grid position and a grid span. Shorthand for setting grid-column-start and grid-column-end in a single declaration.
+         */
+        gridColumn?: any;
+
+        /**
+         * Controls a grid item's placement in a grid area as well as grid position and a grid span. The grid-column-end property (with grid-row-start, grid-row-end, and grid-column-start) determines a grid item's placement by specifying the grid lines of a grid item's grid area.
+         */
+        gridColumnEnd?: any;
+
+        /**
+         * Determines a grid item's placement by specifying the starting grid lines of a grid item's grid area . A grid item's placement in a grid area consists of a grid position and a grid span. See also ( grid-row-start, grid-row-end, and grid-column-end)
+         */
+        gridColumnStart?: any;
+
+        /**
+         * Gets or sets a value that indicates which row an element within a Grid should appear in. Shorthand for setting grid-row-start and grid-row-end in a single declaration.
+         */
+        gridRow?: any;
+
+        /**
+         * Determines a grid item’s placement by specifying the block-end. A grid item's placement in a grid area consists of a grid position and a grid span. The grid-row-end property (with grid-row-start, grid-column-start, and grid-column-end) determines a grid item's placement by specifying the grid lines of a grid item's grid area.
+         */
+        gridRowEnd?: any;
+
+        /**
+         * Specifies a row position based upon an integer location, string value, or desired row size.
+         * css/properties/grid-row is used as short-hand for grid-row-position and grid-row-position
+         */
+        gridRowPosition?: any;
+
+        gridRowSpan?: any;
+
+        /**
+         * Specifies named grid areas which are not associated with any particular grid item, but can be referenced from the grid-placement properties. The syntax of the grid-template-areas property also provides a visualization of the structure of the grid, making the overall layout of the grid container easier to understand.
+         */
+        gridTemplateAreas?: any;
+
+        /**
+         * Specifies (with grid-template-rows) the line names and track sizing functions of the grid. Each sizing function can be specified as a length, a percentage of the grid container’s size, a measurement of the contents occupying the column or row, or a fraction of the free space in the grid.
+         */
+        gridTemplateColumns?: any;
+
+        /**
+         * Specifies (with grid-template-columns) the line names and track sizing functions of the grid. Each sizing function can be specified as a length, a percentage of the grid container’s size, a measurement of the contents occupying the column or row, or a fraction of the free space in the grid.
+         */
+        gridTemplateRows?: any;
+
+        /**
+         * Sets the height of an element. The content area of the element height does not include the padding, border, and margin of the element.
+         */
+        height?: any;
+
+        /**
+         * Specifies the minimum number of characters in a hyphenated word
+         */
+        hyphenateLimitChars?: any;
+
+        /**
+         * Indicates the maximum number of successive hyphenated lines in an element. The ‘no-limit’ value means that there is no limit.
+         */
+        hyphenateLimitLines?: any;
+
+        /**
+         * Specifies the maximum amount of trailing whitespace (before justification) that may be left in a line before hyphenation is triggered to pull part of a word from the next line back up into the current one.
+         */
+        hyphenateLimitZone?: any;
+
+        /**
+         * Specifies whether or not words in a sentence can be split by the use of a manual or automatic hyphenation mechanism.
+         */
+        hyphens?: any;
+
+        imeMode?: any;
+
+        /**
+         * Defines how the browser distributes space between and around flex items
+         * along the main-axis of their container.
+         */
+        justifyContent?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around";
+
+        layoutGrid?: any;
+
+        layoutGridChar?: any;
+
+        layoutGridLine?: any;
+
+        layoutGridMode?: any;
+
+        layoutGridType?: any;
+
+        /**
+         * Sets the left edge of an element
+         */
+        left?: any;
+
+        /**
+         * The letter-spacing CSS property specifies the spacing behavior between text characters.
+         */
+        letterSpacing?: any;
+
+        /**
+         * Deprecated. Gets or sets line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean.
+         */
+        lineBreak?: any;
+
         lineClamp?: number;
+
+        /**
+         * Specifies the height of an inline block level element.
+         */
         lineHeight?: number | string;
+
+        /**
+         * Shorthand property that sets the list-style-type, list-style-position and list-style-image properties in one declaration.
+         */
+        listStyle?: any;
+
+        /**
+         * This property sets the image that will be used as the list item marker. When the image is available, it will replace the marker set with the 'list-style-type' marker. That also means that if the image is not available, it will show the style specified by list-style-property
+         */
+        listStyleImage?: any;
+
+        /**
+         * Specifies if the list-item markers should appear inside or outside the content flow.
+         */
+        listStylePosition?: any;
+
+        /**
+         * Specifies the type of list-item marker in a list.
+         */
+        listStyleType?: any;
+
+        /**
+         * The margin property is shorthand to allow you to set all four margins of an element at once. Its equivalent longhand properties are margin-top, margin-right, margin-bottom and margin-left. Negative values are also allowed.
+         */
+        margin?: any;
+
+        /**
+         * margin-bottom sets the bottom margin of an element.
+         */
+        marginBottom?: any;
+
+        /**
+         * margin-left sets the left margin of an element.
+         */
+        marginLeft?: any;
+
+        /**
+         * margin-right sets the right margin of an element.
+         */
+        marginRight?: any;
+
+        /**
+         * margin-top sets the top margin of an element.
+         */
+        marginTop?: any;
+
+        /**
+         * The marquee-direction determines the initial direction in which the marquee content moves.
+         */
+        marqueeDirection?: any;
+
+        /**
+         * The 'marquee-style' property determines a marquee's scrolling behavior.
+         */
+        marqueeStyle?: any;
+
+        /**
+         * This property is shorthand for setting mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-composite and mask-size. Omitted values are set to their original properties' initial values.
+         */
+        mask?: any;
+
+        /**
+         * This property is shorthand for setting mask-border-source, mask-border-slice, mask-border-width, mask-border-outset, and mask-border-repeat. Omitted values are set to their original properties' initial values.
+         */
+        maskBorder?: any;
+
+        /**
+         * This property specifies how the images for the sides and the middle part of the mask image are scaled and tiled. The first keyword applies to the horizontal sides, the second one applies to the vertical ones. If the second keyword is absent, it is assumed to be the same as the first, similar to the CSS border-image-repeat property.
+         */
+        maskBorderRepeat?: any;
+
+        /**
+         * This property specifies inward offsets from the top, right, bottom, and left edges of the mask image, dividing it into nine regions: four corners, four edges, and a middle. The middle image part is discarded and treated as fully transparent black unless the fill keyword is present. The four values set the top, right, bottom and left offsets in that order, similar to the CSS border-image-slice property.
+         */
+        maskBorderSlice?: any;
+
+        /**
+         * Specifies an image to be used as a mask. An image that is empty, fails to download, is non-existent, or cannot be displayed is ignored and does not mask the element.
+         */
+        maskBorderSource?: any;
+
+        /**
+         * This property sets the width of the mask box image, similar to the CSS border-image-width property.
+         */
+        maskBorderWidth?: any;
+
+        /**
+         * Determines the mask painting area, which defines the area that is affected by the mask. The painted content of an element may be restricted to this area.
+         */
+        maskClip?: any;
+
+        /**
+         * For elements rendered as a single box, specifies the mask positioning area. For elements rendered as multiple boxes (e.g., inline boxes on several lines, boxes on several pages) specifies which boxes box-decoration-break operates on to determine the mask positioning area(s).
+         */
+        maskOrigin?: any;
+
+        /**
+         * This property must not be used. It is no longer included in any standard or standard track specification, nor is it implemented in any browser. It is only used when the text-align-last property is set to size. It controls allowed adjustments of font-size to fit line content.
+         */
+        maxFontSize?: any;
+
+        /**
+         * Sets the maximum height for an element. It prevents the height of the element to exceed the specified value. If min-height is specified and is greater than max-height, max-height is overridden.
+         */
+        maxHeight?: any;
+
+        /**
+         * Sets the maximum width for an element. It limits the width property to be larger than the value specified in max-width.
+         */
+        maxWidth?: any;
+
+        /**
+         * Sets the minimum height for an element. It prevents the height of the element to be smaller than the specified value. The value of min-height overrides both max-height and height.
+         */
+        minHeight?: any;
+
+        /**
+         * Sets the minimum width of an element. It limits the width property to be not smaller than the value specified in min-width.
+         */
+        minWidth?: any;
+
+        /**
+         * Specifies the transparency of an element.
+         */
         opacity?: number;
+
+        /**
+         * Specifies the order used to lay out flex items in their flex container.
+         * Elements are laid out in the ascending order of the order value.
+         */
         order?: number;
-        orphans?: number;
-        widows?: number;
-        zIndex?: number;
-        zoom?: number;
 
-        fontSize?: number | string;
+        /**
+         * In paged media, this property defines the minimum number of lines in
+         * a block container that must be left at the bottom of the page.
+         */
+        orphans?: number;
 
-        // SVG-related properties
-        fillOpacity?: number;
+        /**
+         * The CSS outline property is a shorthand property for setting one or more of the individual outline properties outline-style, outline-width and outline-color in a single rule. In most cases the use of this shortcut is preferable and more convenient.
+         * Outlines differ from borders in the following ways:  •       Outlines do not take up space, they are drawn above the content.
+         *      •       Outlines may be non-rectangular. They are rectangular in Gecko/Firefox. Internet Explorer attempts to place the smallest contiguous outline around all elements or shapes that are indicated to have an outline. Opera draws a non-rectangular shape around a construct.
+         */
+        outline?: any;
+
+        /**
+         * The outline-color property sets the color of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out.
+         */
+        outlineColor?: any;
+
+        /**
+         * The outline-offset property offsets the outline and draw it beyond the border edge.
+         */
+        outlineOffset?: any;
+
+        /**
+         * The overflow property controls how extra content exceeding the bounding box of an element is rendered. It can be used in conjunction with an element that has a fixed width and height, to eliminate text-induced page distortion.
+         */
+        overflow?: any;
+
+        /**
+         * Specifies the preferred scrolling methods for elements that overflow.
+         */
+        overflowStyle?: any;
+
+        /**
+         * Controls how extra content exceeding the x-axis of the bounding box of an element is rendered.
+         */
+        overflowX?: any;
+
+        /**
+         * Controls how extra content exceeding the y-axis of the bounding box of an element is rendered.
+         */
+        overflowY?: any;
+
+        /**
+         * The padding optional CSS property sets the required padding space on one to four sides of an element. The padding area is the space between an element and its border. Negative values are not allowed but decimal values are permitted. The element size is treated as fixed, and the content of the element shifts toward the center as padding is increased.
+         * The padding property is a shorthand to avoid setting each side separately (padding-top, padding-right, padding-bottom, padding-left).
+         */
+        padding?: any;
+
+        /**
+         * The padding-bottom CSS property of an element sets the padding space required on the bottom of an element. The padding area is the space between the content of the element and its border. Contrary to margin-bottom values, negative values of padding-bottom are invalid.
+         */
+        paddingBottom?: any;
+
+        /**
+         * The padding-left CSS property of an element sets the padding space required on the left side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-left values, negative values of padding-left are invalid.
+         */
+        paddingLeft?: any;
+
+        /**
+         * The padding-right CSS property of an element sets the padding space required on the right side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-right values, negative values of padding-right are invalid.
+         */
+        paddingRight?: any;
+
+        /**
+         * The padding-top CSS property of an element sets the padding space required on the top of an element. The padding area is the space between the content of the element and its border. Contrary to margin-top values, negative values of padding-top are invalid.
+         */
+        paddingTop?: any;
+
+        /**
+         * The page-break-after property is supported in all major browsers. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation.
+         */
+        pageBreakAfter?: any;
+
+        /**
+         * The page-break-before property sets the page-breaking behavior before an element. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation.
+         */
+        pageBreakBefore?: any;
+
+        /**
+         * Sets the page-breaking behavior inside an element. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation.
+         */
+        pageBreakInside?: any;
+
+        /**
+         * The pause property determines how long a speech media agent should pause before and after presenting an element. It is a shorthand for the pause-before and pause-after properties.
+         */
+        pause?: any;
+
+        /**
+         * The pause-after property determines how long a speech media agent should pause after presenting an element. It may be replaced by the shorthand property pause, which sets pause time before and after.
+         */
+        pauseAfter?: any;
+
+        /**
+         * The pause-before property determines how long a speech media agent should pause before presenting an element. It may be replaced by the shorthand property pause, which sets pause time before and after.
+         */
+        pauseBefore?: any;
+
+        /**
+         * The perspective property defines how far an element is placed from the view on the z-axis, from the screen to the viewer.
+         * Perspective defines how an object is viewed. In graphic arts, perspective is the representation on a flat surface of what the viewer's eye would see in a 3D space. (See Wikipedia for more information about graphical perspective and for related illustrations.)
+         * The illusion of perspective on a flat surface, such as a computer screen, is created by projecting points on the flat surface as they would appear if the flat surface were a window through which the viewer was looking at the object. In discussion of virtual environments, this flat surface is called a projection plane.
+         */
+        perspective?: any;
+
+        /**
+         * The perspective-origin property establishes the origin for the perspective property. It effectively sets the X and Y position at which the viewer appears to be looking at the children of the element.
+         * When used with perspective, perspective-origin changes the appearance of an object, as if a viewer were looking at it from a different origin. An object appears differently if a viewer is looking directly at it versus looking at it from below, above, or from the side. Thus, the perspective-origin is like a vanishing point.
+         * The default value of perspective-origin is 50% 50%. This displays an object as if the viewer's eye were positioned directly at the center of the screen, both top-to-bottom and left-to-right. A value of 0% 0% changes the object as if the viewer was looking toward the top left angle. A value of 100% 100% changes the appearance as if viewed toward the bottom right angle.
+         */
+        perspectiveOrigin?: any;
+
+        /**
+         * The pointer-events property allows you to control whether an element can be the target for the pointing device (e.g, mouse, pen) events.
+         */
+        pointerEvents?: any;
+
+        /**
+         * The position property controls the type of positioning used by an element within its parent elements. The effect of the position property depends on a lot of factors, for example the position property of parent elements.
+         */
+        position?: any;
+
+        /**
+         * Obsolete: unsupported.
+         * This property determines whether or not a full-width punctuation mark character should be trimmed if it appears at the beginning of a line, so that its "ink" lines up with the first glyph in the line above and below.
+         */
+        punctuationTrim?: any;
+
+        /**
+         * Sets the type of quotation marks for embedded quotations.
+         */
+        quotes?: any;
+
+        /**
+         * Controls whether the last region in a chain displays additional 'overset' content according its default overflow property, or if it displays a fragment of content as if it were flowing into a subsequent region.
+         */
+        regionFragment?: any;
+
+        /**
+         * The rest-after property determines how long a speech media agent should pause after presenting an element's main content, before presenting that element's exit cue sound. It may be replaced by the shorthand property rest, which sets rest time before and after.
+         */
+        restAfter?: any;
+
+        /**
+         * The rest-before property determines how long a speech media agent should pause after presenting an intro cue sound for an element, before presenting that element's main content. It may be replaced by the shorthand property rest, which sets rest time before and after.
+         */
+        restBefore?: any;
+
+        /**
+         * Specifies the position an element in relation to the right side of the containing element.
+         */
+        right?: any;
+
+        rubyAlign?: any;
+
+        rubyPosition?: any;
+
+        /**
+         * Defines the alpha channel threshold used to extract a shape from an image. Can be thought of as a "minimum opacity" threshold; that is, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque.
+         */
+        shapeImageThreshold?: any;
+
+        /**
+         * A future level of CSS Shapes will define a shape-inside property, which will define a shape to wrap content within the element. See Editor's Draft <http://dev.w3.org/csswg/css-shapes/> and CSSWG wiki page on next-level plans <http://wiki.csswg.org/spec/css-shapes>
+         */
+        shapeInside?: any;
+
+        /**
+         * Adds a margin to a shape-outside. In effect, defines a new shape that is the smallest contour around all the points that are the shape-margin distance outward perpendicular to each point on the underlying shape. For points where a perpendicular direction is not defined (e.g., a triangle corner), takes all points on a circle centered at the point and with a radius of the shape-margin distance. This property accepts only non-negative values.
+         */
+        shapeMargin?: any;
+
+        /**
+         * Declares a shape around which text should be wrapped, with possible modifications from the shape-margin property. The shape defined by shape-outside and shape-margin changes the geometry of a float element's float area.
+         */
+        shapeOutside?: any;
+
+        /**
+         * The speak property determines whether or not a speech synthesizer will read aloud the contents of an element.
+         */
+        speak?: any;
+
+        /**
+         * The speak-as property determines how the speech synthesizer interprets the content: words as whole words or as a sequence of letters, numbers as a numerical value or a sequence of digits, punctuation as pauses in speech or named punctuation characters.
+         */
+        speakAs?: any;
+
+        /**
+         * SVG: Specifies the opacity of the outline on the current object.
+         */
         strokeOpacity?: number;
+
+        /**
+         * SVG: Specifies the width of the outline on the current object.
+         */
         strokeWidth?: number;
 
+        /**
+         * The tab-size CSS property is used to customise the width of a tab (U+0009) character.
+         */
+        tabSize?: any;
+
+        /**
+         * The 'table-layout' property controls the algorithm used to lay out the table cells, rows, and columns.
+         */
+        tableLayout?: any;
+
+        /**
+         * The text-align CSS property describes how inline content like text is aligned in its parent block element. text-align does not control the alignment of block elements itself, only their inline content.
+         */
+        textAlign?: any;
+
+        /**
+         * The text-align-last CSS property describes how the last line of a block element or a line before line break is aligned in its parent block element.
+         */
+        textAlignLast?: any;
+
+        /**
+         * The text-decoration CSS property is used to set the text formatting to underline, overline, line-through or blink.
+         * underline and overline decorations are positioned under the text, line-through over it.
+         */
+        textDecoration?: any;
+
+        /**
+         * Sets the color of any text decoration, such as underlines, overlines, and strike throughs.
+         */
+        textDecorationColor?: any;
+
+        /**
+         * Sets what kind of line decorations are added to an element, such as underlines, overlines, etc.
+         */
+        textDecorationLine?: any;
+
+        textDecorationLineThrough?: any;
+
+        textDecorationNone?: any;
+
+        textDecorationOverline?: any;
+
+        /**
+         * Specifies what parts of an element’s content are skipped over when applying any text decoration.
+         */
+        textDecorationSkip?: any;
+
+        /**
+         * This property specifies the style of the text decoration line drawn on the specified element. The intended meaning for the values are the same as those of the border-style-properties.
+         */
+        textDecorationStyle?: any;
+
+        textDecorationUnderline?: any;
+
+        /**
+         * The text-emphasis property will apply special emphasis marks to the elements text. Slightly similar to the text-decoration property only that this property can have affect on the line-height. It also is noted that this is shorthand for text-emphasis-style and for text-emphasis-color.
+         */
+        textEmphasis?: any;
+
+        /**
+         * The text-emphasis-color property specifies the foreground color of the emphasis marks.
+         */
+        textEmphasisColor?: any;
+
+        /**
+         * The text-emphasis-style property applies special emphasis marks to an element's text.
+         */
+        textEmphasisStyle?: any;
+
+        /**
+         * This property helps determine an inline box's block-progression dimension, derived from the text-height and font-size properties for non-replaced elements, the height or the width for replaced elements, and the stacked block-progression dimension for inline-block elements. The block-progression dimension determines the position of the padding, border and margin for the element.
+         */
+        textHeight?: any;
+
+        /**
+         * Specifies the amount of space horizontally that should be left on the first line of the text of an element. This horizontal spacing is at the beginning of the first line and is in respect to the left edge of the containing block box.
+         */
+        textIndent?: any;
+
+        textJustifyTrim?: any;
+
+        textKashidaSpace?: any;
+
+        /**
+         * The text-line-through property is a shorthand property for text-line-through-style, text-line-through-color and text-line-through-mode. (Considered obsolete; use text-decoration instead.)
+         */
+        textLineThrough?: any;
+
+        /**
+         * Specifies the line colors for the line-through text decoration.
+         * (Considered obsolete; use text-decoration-color instead.)
+         */
+        textLineThroughColor?: any;
+
+        /**
+         * Sets the mode for the line-through text decoration, determining whether the text decoration affects the space characters or not.
+         * (Considered obsolete; use text-decoration-skip instead.)
+         */
+        textLineThroughMode?: any;
+
+        /**
+         * Specifies the line style for line-through text decoration.
+         * (Considered obsolete; use text-decoration-style instead.)
+         */
+        textLineThroughStyle?: any;
+
+        /**
+         * Specifies the line width for the line-through text decoration.
+         */
+        textLineThroughWidth?: any;
+
+        /**
+         * The text-overflow shorthand CSS property determines how overflowed content that is not displayed is signaled to the users. It can be clipped, display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) or a Web author-defined string. It covers the two long-hand properties text-overflow-mode and text-overflow-ellipsis
+         */
+        textOverflow?: any;
+
+        /**
+         * The text-overline property is the shorthand for the text-overline-style, text-overline-width, text-overline-color, and text-overline-mode properties.
+         */
+        textOverline?: any;
+
+        /**
+         * Specifies the line color for the overline text decoration.
+         */
+        textOverlineColor?: any;
+
+        /**
+         * Sets the mode for the overline text decoration, determining whether the text decoration affects the space characters or not.
+         */
+        textOverlineMode?: any;
+
+        /**
+         * Specifies the line style for overline text decoration.
+         */
+        textOverlineStyle?: any;
+
+        /**
+         * Specifies the line width for the overline text decoration.
+         */
+        textOverlineWidth?: any;
+
+        /**
+         * The text-rendering CSS property provides information to the browser about how to optimize when rendering text. Options are: legibility, speed or geometric precision.
+         */
+        textRendering?: any;
+
+        /**
+         * Obsolete: unsupported.
+         */
+        textScript?: any;
+
+        /**
+         * The CSS text-shadow property applies one or more drop shadows to the text and <text-decorations> of an element. Each shadow is specified as an offset from the text, along with optional color and blur radius values.
+         */
+        textShadow?: any;
+
+        /**
+         * This property transforms text for styling purposes. (It has no effect on the underlying content.)
+         */
+        textTransform?: any;
+
+        /**
+         * Unsupported.
+         * This property will add a underline position value to the element that has an underline defined.
+         */
+        textUnderlinePosition?: any;
+
+        /**
+         * After review this should be replaced by text-decoration should it not?
+         * This property will set the underline style for text with a line value for underline, overline, and line-through.
+         */
+        textUnderlineStyle?: any;
+
+        /**
+         * This property specifies how far an absolutely positioned box's top margin edge is offset below the top edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the top edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties).
+         */
+        top?: any;
+
+        /**
+         * Determines whether touch input may trigger default behavior supplied by the user agent, such as panning or zooming.
+         */
+        touchAction?: any;
+
+        /**
+         * CSS transforms allow elements styled with CSS to be transformed in two-dimensional or three-dimensional space. Using this property, elements can be translated, rotated, scaled, and skewed. The value list may consist of 2D and/or 3D transform values.
+         */
+        transform?: any;
+
+        /**
+         * This property defines the origin of the transformation axes relative to the element to which the transformation is applied.
+         */
+        transformOrigin?: any;
+
+        /**
+         * This property allows you to define the relative position of the origin of the transformation grid along the z-axis.
+         */
+        transformOriginZ?: any;
+
+        /**
+         * This property specifies how nested elements are rendered in 3D space relative to their parent.
+         */
+        transformStyle?: any;
+
+        /**
+         * The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, and transition-delay. It allows to define the transition between two states of an element.
+         */
+        transition?: any;
+
+        /**
+         * Defines when the transition will start. A value of ‘0s’ means the transition will execute as soon as the property is changed. Otherwise, the value specifies an offset from the moment the property is changed, and the transition will delay execution by that offset.
+         */
+        transitionDelay?: any;
+
+        /**
+         * The 'transition-duration' property specifies the length of time a transition animation takes to complete.
+         */
+        transitionDuration?: any;
+
+        /**
+         * The 'transition-property' property specifies the name of the CSS property to which the transition is applied.
+         */
+        transitionProperty?: any;
+
+        /**
+         * Sets the pace of action within a transition
+         */
+        transitionTimingFunction?: any;
+
+        /**
+         * The unicode-bidi CSS property specifies the level of embedding with respect to the bidirectional algorithm.
+         */
+        unicodeBidi?: any;
+
+        /**
+         * unicode-range allows you to set a specific range of characters to be downloaded from a font (embedded using @font-face) and made available for use on the current page.
+         */
+        unicodeRange?: any;
+
+        /**
+         * This is for all the high level UX stuff.
+         */
+        userFocus?: any;
+
+        /**
+         * For inputing user content
+         */
+        userInput?: any;
+
+        /**
+         * The vertical-align property controls how inline elements or text are vertically aligned compared to the baseline. If this property is used on table-cells it controls the vertical alignment of content of the table cell.
+         */
+        verticalAlign?: any;
+
+        /**
+         * The visibility property specifies whether the boxes generated by an element are rendered.
+         */
+        visibility?: any;
+
+        /**
+         * The voice-balance property sets the apparent position (in stereo sound) of the synthesized voice for spoken media.
+         */
+        voiceBalance?: any;
+
+        /**
+         * The voice-duration property allows the author to explicitly set the amount of time it should take a speech synthesizer to read an element's content, for example to allow the speech to be synchronized with other media. With a value of auto (the default) the length of time it takes to read the content is determined by the content itself and the voice-rate property.
+         */
+        voiceDuration?: any;
+
+        /**
+         * The voice-family property sets the speaker's voice used by a speech media agent to read an element. The speaker may be specified as a named character (to match a voice option in the speech reading software) or as a generic description of the age and gender of the voice. Similar to the font-family property for visual media, a comma-separated list of fallback options may be given in case the speech reader does not recognize the character name or cannot synthesize the requested combination of generic properties.
+         */
+        voiceFamily?: any;
+
+        /**
+         * The voice-pitch property sets pitch or tone (high or low) for the synthesized speech when reading an element; the pitch may be specified absolutely or relative to the normal pitch for the voice-family used to read the text.
+         */
+        voicePitch?: any;
+
+        /**
+         * The voice-range property determines how much variation in pitch or tone will be created by the speech synthesize when reading an element. Emphasized text, grammatical structures and punctuation may all be rendered as changes in pitch, this property determines how strong or obvious those changes are; large ranges are associated with enthusiastic or emotional speech, while small ranges are associated with flat or mechanical speech.
+         */
+        voiceRange?: any;
+
+        /**
+         * The voice-rate property sets the speed at which the voice synthesized by a speech media agent will read content.
+         */
+        voiceRate?: any;
+
+        /**
+         * The voice-stress property sets the level of vocal emphasis to be used for synthesized speech reading the element.
+         */
+        voiceStress?: any;
+
+        /**
+         * The voice-volume property sets the volume for spoken content in speech media. It replaces the deprecated volume property.
+         */
+        voiceVolume?: any;
+
+        /**
+         * The white-space property controls whether and how white space inside the element is collapsed, and whether lines may wrap at unforced "soft wrap" opportunities.
+         */
+        whiteSpace?: any;
+
+        /**
+         * Obsolete: unsupported.
+         */
+        whiteSpaceTreatment?: any;
+
+        /**
+         * In paged media, this property defines the mimimum number of lines
+         * that must be left at the top of the second page.
+         */
+        widows?: number;
+
+        /**
+         * Specifies the width of the content area of an element. The content area of the element width does not include the padding, border, and margin of the element.
+         */
+        width?: any;
+
+        /**
+         * The word-break property is often used when there is long generated content that is strung together without and spaces or hyphens to beak apart. A common case of this is when there is a long URL that does not have any hyphens. This case could potentially cause the breaking of the layout as it could extend past the parent element.
+         */
+        wordBreak?: any;
+
+        /**
+         * The word-spacing CSS property specifies the spacing behavior between "words".
+         */
+        wordSpacing?: any;
+
+        /**
+         * An alias of css/properties/overflow-wrap, word-wrap defines whether to break words when the content exceeds the boundaries of its container.
+         */
+        wordWrap?: any;
+
+        /**
+         * Specifies how exclusions affect inline content within block-level elements. Elements lay out their inline content in their content area but wrap around exclusion areas.
+         */
+        wrapFlow?: any;
+
+        /**
+         * Set the value that is used to offset the inner wrap shape from other shapes. Inline content that intersects a shape with this property will be pushed by this shape's margin.
+         */
+        wrapMargin?: any;
+
+        /**
+         * Obsolete and unsupported. Do not use.
+         * This CSS property controls the text when it reaches the end of the block in which it is enclosed.
+         */
+        wrapOption?: any;
+
+        /**
+         * writing-mode specifies if lines of text are laid out horizontally or vertically, and the direction which lines of text and blocks progress.
+         */
+        writingMode?: any;
+
+        /**
+         * The z-index property specifies the z-order of an element and its descendants.
+         * When elements overlap, z-order determines which one covers the other.
+         */
+        zIndex?: "auto" | number;
+
+        /**
+         * Sets the initial zoom factor of a document defined by @viewport.
+         */
+        zoom?: "auto" | number;
+
         [propertyName: string]: any;
     }
 
-    interface HTMLAttributes extends DOMAttributes {
+    interface HTMLAttributes<T> extends DOMAttributes<T> {
         // React-specific Attributes
         defaultChecked?: boolean;
         defaultValue?: string | string[];
@@ -508,7 +1974,6 @@ declare namespace __React {
         hrefLang?: string;
         htmlFor?: string;
         httpEquiv?: string;
-        icon?: string;
         id?: string;
         inputMode?: string;
         integrity?: string;
@@ -534,6 +1999,7 @@ declare namespace __React {
         multiple?: boolean;
         muted?: boolean;
         name?: string;
+        nonce?: string;
         noValidate?: boolean;
         open?: boolean;
         optimum?: number;
@@ -545,6 +2011,7 @@ declare namespace __React {
         readOnly?: boolean;
         rel?: string;
         required?: boolean;
+        reversed?: boolean;
         role?: string;
         rows?: number;
         rowSpan?: number;
@@ -572,7 +2039,7 @@ declare namespace __React {
         title?: string;
         type?: string;
         useMap?: string;
-        value?: string | string[];
+        value?: string | string[] | number;
         width?: number | string;
         wmode?: string;
         wrap?: string;
@@ -588,7 +2055,7 @@ declare namespace __React {
         vocab?: string;
 
         // Non-standard Attributes
-        autoCapitalize?: boolean;
+        autoCapitalize?: string;
         autoCorrect?: string;
         autoSave?: string;
         color?: string;
@@ -602,7 +2069,7 @@ declare namespace __React {
         unselectable?: boolean;
     }
 
-    interface SVGAttributes extends HTMLAttributes {
+    interface SVGAttributes<T> extends HTMLAttributes<T> {
         clipPath?: string;
         cx?: number | string;
         cy?: number | string;
@@ -611,6 +2078,7 @@ declare namespace __React {
         dy?: number | string;
         fill?: string;
         fillOpacity?: number | string;
+        fillRule?: string;
         fontFamily?: string;
         fontSize?: number | string;
         fx?: number | string;
@@ -620,6 +2088,7 @@ declare namespace __React {
         markerEnd?: string;
         markerMid?: string;
         markerStart?: string;
+        mask?: string;
         offset?: number | string;
         opacity?: number | string;
         patternContentUnits?: string;
@@ -634,7 +2103,9 @@ declare namespace __React {
         stopOpacity?: number | string;
         stroke?: string;
         strokeDasharray?: string;
-        strokeLinecap?: string;
+        strokeLinecap?: "butt" | "round" | "square" | "inherit";
+        strokeLinejoin?: "miter" | "round" | "bevel" | "inherit";
+        strokeMiterlimit?: string;
         strokeOpacity?: number | string;
         strokeWidth?: number | string;
         textAnchor?: string;
@@ -655,7 +2126,7 @@ declare namespace __React {
         xmlLang?: string;
         xmlSpace?: string;
         y1?: number | string;
-        y2?: number | string
+        y2?: number | string;
         y?: number | string;
     }
 
@@ -665,118 +2136,119 @@ declare namespace __React {
 
     interface ReactDOM {
         // HTML
-        a: HTMLFactory;
-        abbr: HTMLFactory;
-        address: HTMLFactory;
-        area: HTMLFactory;
-        article: HTMLFactory;
-        aside: HTMLFactory;
-        audio: HTMLFactory;
-        b: HTMLFactory;
-        base: HTMLFactory;
-        bdi: HTMLFactory;
-        bdo: HTMLFactory;
-        big: HTMLFactory;
-        blockquote: HTMLFactory;
-        body: HTMLFactory;
-        br: HTMLFactory;
-        button: HTMLFactory;
-        canvas: HTMLFactory;
-        caption: HTMLFactory;
-        cite: HTMLFactory;
-        code: HTMLFactory;
-        col: HTMLFactory;
-        colgroup: HTMLFactory;
-        data: HTMLFactory;
-        datalist: HTMLFactory;
-        dd: HTMLFactory;
-        del: HTMLFactory;
-        details: HTMLFactory;
-        dfn: HTMLFactory;
-        dialog: HTMLFactory;
-        div: HTMLFactory;
-        dl: HTMLFactory;
-        dt: HTMLFactory;
-        em: HTMLFactory;
-        embed: HTMLFactory;
-        fieldset: HTMLFactory;
-        figcaption: HTMLFactory;
-        figure: HTMLFactory;
-        footer: HTMLFactory;
-        form: HTMLFactory;
-        h1: HTMLFactory;
-        h2: HTMLFactory;
-        h3: HTMLFactory;
-        h4: HTMLFactory;
-        h5: HTMLFactory;
-        h6: HTMLFactory;
-        head: HTMLFactory;
-        header: HTMLFactory;
-        hr: HTMLFactory;
-        html: HTMLFactory;
-        i: HTMLFactory;
-        iframe: HTMLFactory;
-        img: HTMLFactory;
-        input: HTMLFactory;
-        ins: HTMLFactory;
-        kbd: HTMLFactory;
-        keygen: HTMLFactory;
-        label: HTMLFactory;
-        legend: HTMLFactory;
-        li: HTMLFactory;
-        link: HTMLFactory;
-        main: HTMLFactory;
-        map: HTMLFactory;
-        mark: HTMLFactory;
-        menu: HTMLFactory;
-        menuitem: HTMLFactory;
-        meta: HTMLFactory;
-        meter: HTMLFactory;
-        nav: HTMLFactory;
-        noscript: HTMLFactory;
-        object: HTMLFactory;
-        ol: HTMLFactory;
-        optgroup: HTMLFactory;
-        option: HTMLFactory;
-        output: HTMLFactory;
-        p: HTMLFactory;
-        param: HTMLFactory;
-        picture: HTMLFactory;
-        pre: HTMLFactory;
-        progress: HTMLFactory;
-        q: HTMLFactory;
-        rp: HTMLFactory;
-        rt: HTMLFactory;
-        ruby: HTMLFactory;
-        s: HTMLFactory;
-        samp: HTMLFactory;
-        script: HTMLFactory;
-        section: HTMLFactory;
-        select: HTMLFactory;
-        small: HTMLFactory;
-        source: HTMLFactory;
-        span: HTMLFactory;
-        strong: HTMLFactory;
-        style: HTMLFactory;
-        sub: HTMLFactory;
-        summary: HTMLFactory;
-        sup: HTMLFactory;
-        table: HTMLFactory;
-        tbody: HTMLFactory;
-        td: HTMLFactory;
-        textarea: HTMLFactory;
-        tfoot: HTMLFactory;
-        th: HTMLFactory;
-        thead: HTMLFactory;
-        time: HTMLFactory;
-        title: HTMLFactory;
-        tr: HTMLFactory;
-        track: HTMLFactory;
-        u: HTMLFactory;
-        ul: HTMLFactory;
-        "var": HTMLFactory;
-        video: HTMLFactory;
-        wbr: HTMLFactory;
+        a: HTMLFactory<HTMLAnchorElement>;
+        abbr: HTMLFactory<HTMLElement>;
+        address: HTMLFactory<HTMLElement>;
+        area: HTMLFactory<HTMLAreaElement>;
+        article: HTMLFactory<HTMLElement>;
+        aside: HTMLFactory<HTMLElement>;
+        audio: HTMLFactory<HTMLAudioElement>;
+        b: HTMLFactory<HTMLElement>;
+        base: HTMLFactory<HTMLBaseElement>;
+        bdi: HTMLFactory<HTMLElement>;
+        bdo: HTMLFactory<HTMLElement>;
+        big: HTMLFactory<HTMLElement>;
+        blockquote: HTMLFactory<HTMLElement>;
+        body: HTMLFactory<HTMLBodyElement>;
+        br: HTMLFactory<HTMLBRElement>;
+        button: HTMLFactory<HTMLButtonElement>;
+        canvas: HTMLFactory<HTMLCanvasElement>;
+        caption: HTMLFactory<HTMLElement>;
+        cite: HTMLFactory<HTMLElement>;
+        code: HTMLFactory<HTMLElement>;
+        col: HTMLFactory<HTMLTableColElement>;
+        colgroup: HTMLFactory<HTMLTableColElement>;
+        data: HTMLFactory<HTMLElement>;
+        datalist: HTMLFactory<HTMLDataListElement>;
+        dd: HTMLFactory<HTMLElement>;
+        del: HTMLFactory<HTMLElement>;
+        details: HTMLFactory<HTMLElement>;
+        dfn: HTMLFactory<HTMLElement>;
+        dialog: HTMLFactory<HTMLElement>;
+        div: HTMLFactory<HTMLDivElement>;
+        dl: HTMLFactory<HTMLDListElement>;
+        dt: HTMLFactory<HTMLElement>;
+        em: HTMLFactory<HTMLElement>;
+        embed: HTMLFactory<HTMLEmbedElement>;
+        fieldset: HTMLFactory<HTMLFieldSetElement>;
+        figcaption: HTMLFactory<HTMLElement>;
+        figure: HTMLFactory<HTMLElement>;
+        footer: HTMLFactory<HTMLElement>;
+        form: HTMLFactory<HTMLFormElement>;
+        h1: HTMLFactory<HTMLHeadingElement>;
+        h2: HTMLFactory<HTMLHeadingElement>;
+        h3: HTMLFactory<HTMLHeadingElement>;
+        h4: HTMLFactory<HTMLHeadingElement>;
+        h5: HTMLFactory<HTMLHeadingElement>;
+        h6: HTMLFactory<HTMLHeadingElement>;
+        head: HTMLFactory<HTMLHeadElement>;
+        header: HTMLFactory<HTMLElement>;
+        hgroup: HTMLFactory<HTMLElement>;
+        hr: HTMLFactory<HTMLHRElement>;
+        html: HTMLFactory<HTMLHtmlElement>;
+        i: HTMLFactory<HTMLElement>;
+        iframe: HTMLFactory<HTMLIFrameElement>;
+        img: HTMLFactory<HTMLImageElement>;
+        input: HTMLFactory<HTMLInputElement>;
+        ins: HTMLFactory<HTMLModElement>;
+        kbd: HTMLFactory<HTMLElement>;
+        keygen: HTMLFactory<HTMLElement>;
+        label: HTMLFactory<HTMLLabelElement>;
+        legend: HTMLFactory<HTMLLegendElement>;
+        li: HTMLFactory<HTMLLIElement>;
+        link: HTMLFactory<HTMLLinkElement>;
+        main: HTMLFactory<HTMLElement>;
+        map: HTMLFactory<HTMLMapElement>;
+        mark: HTMLFactory<HTMLElement>;
+        menu: HTMLFactory<HTMLElement>;
+        menuitem: HTMLFactory<HTMLElement>;
+        meta: HTMLFactory<HTMLMetaElement>;
+        meter: HTMLFactory<HTMLElement>;
+        nav: HTMLFactory<HTMLElement>;
+        noscript: HTMLFactory<HTMLElement>;
+        object: HTMLFactory<HTMLObjectElement>;
+        ol: HTMLFactory<HTMLOListElement>;
+        optgroup: HTMLFactory<HTMLOptGroupElement>;
+        option: HTMLFactory<HTMLOptionElement>;
+        output: HTMLFactory<HTMLElement>;
+        p: HTMLFactory<HTMLParagraphElement>;
+        param: HTMLFactory<HTMLParamElement>;
+        picture: HTMLFactory<HTMLElement>;
+        pre: HTMLFactory<HTMLPreElement>;
+        progress: HTMLFactory<HTMLProgressElement>;
+        q: HTMLFactory<HTMLQuoteElement>;
+        rp: HTMLFactory<HTMLElement>;
+        rt: HTMLFactory<HTMLElement>;
+        ruby: HTMLFactory<HTMLElement>;
+        s: HTMLFactory<HTMLElement>;
+        samp: HTMLFactory<HTMLElement>;
+        script: HTMLFactory<HTMLElement>;
+        section: HTMLFactory<HTMLElement>;
+        select: HTMLFactory<HTMLSelectElement>;
+        small: HTMLFactory<HTMLElement>;
+        source: HTMLFactory<HTMLSourceElement>;
+        span: HTMLFactory<HTMLSpanElement>;
+        strong: HTMLFactory<HTMLElement>;
+        style: HTMLFactory<HTMLStyleElement>;
+        sub: HTMLFactory<HTMLElement>;
+        summary: HTMLFactory<HTMLElement>;
+        sup: HTMLFactory<HTMLElement>;
+        table: HTMLFactory<HTMLTableElement>;
+        tbody: HTMLFactory<HTMLTableSectionElement>;
+        td: HTMLFactory<HTMLTableDataCellElement>;
+        textarea: HTMLFactory<HTMLTextAreaElement>;
+        tfoot: HTMLFactory<HTMLTableSectionElement>;
+        th: HTMLFactory<HTMLTableHeaderCellElement>;
+        thead: HTMLFactory<HTMLTableSectionElement>;
+        time: HTMLFactory<HTMLElement>;
+        title: HTMLFactory<HTMLTitleElement>;
+        tr: HTMLFactory<HTMLTableRowElement>;
+        track: HTMLFactory<HTMLTrackElement>;
+        u: HTMLFactory<HTMLElement>;
+        ul: HTMLFactory<HTMLUListElement>;
+        "var": HTMLFactory<HTMLElement>;
+        video: HTMLFactory<HTMLVideoElement>;
+        wbr: HTMLFactory<HTMLElement>;
 
         // SVG
         svg: SVGFactory;
@@ -795,8 +2267,10 @@ declare namespace __React {
         radialGradient: SVGFactory;
         rect: SVGFactory;
         stop: SVGFactory;
+        symbol: SVGFactory;
         text: SVGFactory;
         tspan: SVGFactory;
+        use: SVGFactory;
     }
 
     //
@@ -841,7 +2315,7 @@ declare namespace __React {
         map<T>(children: ReactNode, fn: (child: ReactChild, index: number) => T): T[];
         forEach(children: ReactNode, fn: (child: ReactChild, index: number) => any): void;
         count(children: ReactNode): number;
-        only(children: ReactNode): ReactChild;
+        only(children: ReactNode): ReactElement<any>;
         toArray(children: ReactNode): ReactChild[];
     }
 
@@ -883,17 +2357,13 @@ declare namespace JSX {
 
     interface Element extends React.ReactElement<any> { }
     interface ElementClass extends React.Component<any, any> {
-        render(): JSX.Element;
+        render(): JSX.Element | null;
     }
     interface ElementAttributesProperty { props: {}; }
 
-    interface IntrinsicAttributes {
-        key?: string | number;
-    }
+    interface IntrinsicAttributes extends React.Attributes { }
 
-    interface IntrinsicClassAttributes<T> {
-        ref?: string | ((classInstance: T) => void);
-    }
+    interface IntrinsicClassAttributes<T> extends React.ClassAttributes<T> { }
 
     interface IntrinsicElements {
         // HTML