mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 16:34:36 -05:00
Undo comment override from merge.
This commit is contained in:
@@ -14478,8 +14478,8 @@ namespace ts {
|
||||
if (produceDiagnostics && clause.kind === SyntaxKind.CaseClause) {
|
||||
const caseClause = <CaseClause>clause;
|
||||
// TypeScript 1.0 spec (April 2014): 5.9
|
||||
// In a 'switch' statement, each 'case' expression must be of a type that is assignable to or from the type of the 'switch' expression.
|
||||
// TODO (drosen): this needs to be amended to reflect the "comparable" relationship.
|
||||
// In a 'switch' statement, each 'case' expression must be of a type that is comparable
|
||||
// to or from the type of the 'switch' expression.
|
||||
const caseType = checkExpression(caseClause.expression);
|
||||
if (!isTypeComparableTo(expressionType, caseType)) {
|
||||
// expressionType is not comparable to caseType, try the reversed check and report errors if it fails
|
||||
|
||||
Reference in New Issue
Block a user