From 758cdf337872067758ab65efbb850cfd6465da1d Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 30 Aug 2015 15:07:04 -0700 Subject: [PATCH] Only obtain regular type of fresh object literal type if necessary --- src/compiler/checker.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e624eb41d86..58b7e920bff 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4640,7 +4640,9 @@ namespace ts { // and intersection types are further deconstructed on the target side, we don't want to // make the check again (as it might fail for a partial target type). Therefore we obtain // the regular source type and proceed with that. - source = getRegularTypeOfObjectLiteral(source); + if (target.flags & TypeFlags.UnionOrIntersection) { + source = getRegularTypeOfObjectLiteral(source); + } } let saveErrorInfo = errorInfo;