mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Address feedback
This commit is contained in:
@@ -2503,7 +2503,7 @@ module ts {
|
||||
}
|
||||
|
||||
// For a type parameter, return the base constraint of the type parameter. For the string, number,
|
||||
// boolean, and symbol primitive types, return the corresponding object types.Otherwise return the
|
||||
// boolean, and symbol primitive types, return the corresponding object types. Otherwise return the
|
||||
// type itself. Note that the apparent type of a union type is the union type itself.
|
||||
function getApparentType(type: Type): Type {
|
||||
if (type.flags & TypeFlags.TypeParameter) {
|
||||
@@ -5538,7 +5538,7 @@ module ts {
|
||||
if (!links.resolvedType) {
|
||||
links.resolvedType = checkExpression(node.expression);
|
||||
|
||||
// This will allow types number, string, Symbol or any. It will also allow enums, the unknown
|
||||
// This will allow types number, string, symbol or any. It will also allow enums, the unknown
|
||||
// type, and any union of these types (like string | number).
|
||||
if (!isTypeOfKind(links.resolvedType, TypeFlags.Any | TypeFlags.NumberLike | TypeFlags.StringLike | TypeFlags.ESSymbol)) {
|
||||
error(node, Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any);
|
||||
|
||||
Reference in New Issue
Block a user