Merge branch 'master' of https://github.com/Microsoft/TypeScript into update-types3
This commit is contained in:
commit
4f61eef4c3
3 changed files with 10 additions and 4 deletions
|
@ -7435,6 +7435,12 @@ namespace ts {
|
||||||
type = <UnionType>createType(TypeFlags.Union | propagatedFlags);
|
type = <UnionType>createType(TypeFlags.Union | propagatedFlags);
|
||||||
unionTypes.set(id, type);
|
unionTypes.set(id, type);
|
||||||
type.types = types;
|
type.types = types;
|
||||||
|
/*
|
||||||
|
Note: This is the alias symbol (or lack thereof) that we see when we first encounter this union type.
|
||||||
|
For aliases of identical unions, eg `type T = A | B; type U = A | B`, the symbol of the first alias encountered is the aliasSymbol.
|
||||||
|
(In the language service, the order may depend on the order in which a user takes actions, such as hovering over symbols.)
|
||||||
|
It's important that we create equivalent union types only once, so that's an unfortunate side effect.
|
||||||
|
*/
|
||||||
type.aliasSymbol = aliasSymbol;
|
type.aliasSymbol = aliasSymbol;
|
||||||
type.aliasTypeArguments = aliasTypeArguments;
|
type.aliasTypeArguments = aliasTypeArguments;
|
||||||
}
|
}
|
||||||
|
@ -7528,7 +7534,7 @@ namespace ts {
|
||||||
type = <IntersectionType>createType(TypeFlags.Intersection | propagatedFlags);
|
type = <IntersectionType>createType(TypeFlags.Intersection | propagatedFlags);
|
||||||
intersectionTypes.set(id, type);
|
intersectionTypes.set(id, type);
|
||||||
type.types = typeSet;
|
type.types = typeSet;
|
||||||
type.aliasSymbol = aliasSymbol;
|
type.aliasSymbol = aliasSymbol; // See comment in `getUnionTypeFromSortedList`.
|
||||||
type.aliasTypeArguments = aliasTypeArguments;
|
type.aliasTypeArguments = aliasTypeArguments;
|
||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
|
|
|
@ -245,7 +245,7 @@ namespace ts {
|
||||||
const redForegroundEscapeSequence = "\u001b[91m";
|
const redForegroundEscapeSequence = "\u001b[91m";
|
||||||
const yellowForegroundEscapeSequence = "\u001b[93m";
|
const yellowForegroundEscapeSequence = "\u001b[93m";
|
||||||
const blueForegroundEscapeSequence = "\u001b[93m";
|
const blueForegroundEscapeSequence = "\u001b[93m";
|
||||||
const gutterStyleSequence = "\u001b[100;30m";
|
const gutterStyleSequence = "\u001b[30;47m";
|
||||||
const gutterSeparator = " ";
|
const gutterSeparator = " ";
|
||||||
const resetEscapeSequence = "\u001b[0m";
|
const resetEscapeSequence = "\u001b[0m";
|
||||||
const ellipsis = "...";
|
const ellipsis = "...";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
[100;30m2[0m
|
[30;47m2[0m
|
||||||
[100;30m [0m [91m[0m
|
[30;47m [0m [91m[0m
|
||||||
|
|
||||||
tests/cases/compiler/index.ts(2,1): [91merror[0m TS1005: '}' expected.
|
tests/cases/compiler/index.ts(2,1): [91merror[0m TS1005: '}' expected.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue