@@ -4447,9 +4447,14 @@ namespace ts {
4447
4447
return property;
4448
4448
}
4449
4449
4450
- // Return the symbol for the property with the given name in the given type. Creates synthetic union properties when
4451
- // necessary, maps primitive types and type parameters are to their apparent types, and augments with properties from
4452
- // Object and Function as appropriate.
4450
+ /**
4451
+ * Return the symbol for the property with the given name in the given type. Creates synthetic union properties when
4452
+ * necessary, maps primitive types and type parameters are to their apparent types, and augments with properties from
4453
+ * Object and Function as appropriate.
4454
+ *
4455
+ * @param type a type to look up property from
4456
+ * @param name a name of property to look up in a given type
4457
+ */
4453
4458
function getPropertyOfType(type: Type, name: string): Symbol {
4454
4459
type = getApparentType(type);
4455
4460
if (type.flags & TypeFlags.ObjectType) {
@@ -12856,6 +12861,9 @@ namespace ts {
12856
12861
return checkDestructuringAssignment(element, type, contextualMapper);
12857
12862
}
12858
12863
else {
12864
+ // We still need to check element expression here because we may need to set appropriate flag on the expression
12865
+ // such as NodeCheckFlags.LexicalThis on "this"expression.
12866
+ checkExpression(element);
12859
12867
if (isTupleType(sourceType)) {
12860
12868
error(element, Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(sourceType), (<TupleType>sourceType).elementTypes.length, elements.length);
12861
12869
}
0 commit comments