File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -28247,7 +28247,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
28247
28247
// if they're not equal then they're not related and we can skip doing a bunch of work.
28248
28248
if (t.flags & TypeFlags.Literal && (t.flags & TypeFlags.Literal) === (c.flags & TypeFlags.Literal)) {
28249
28249
if (t.flags & TypeFlags.BooleanLiteral) {
28250
- return t === c ? t : neverType;
28250
+ const tIsTrue = t === trueType || t === regularTrueType;
28251
+ const cIsTrue = c === trueType || c === regularTrueType;
28252
+ return tIsTrue === cIsTrue ? t : neverType;
28251
28253
}
28252
28254
return (t as LiteralType).value === (c as LiteralType).value ? t : neverType;
28253
28255
}
@@ -28256,6 +28258,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
28256
28258
if (isTypeStrictSubtypeOf(c, t)) return c;
28257
28259
28258
28260
// Strict subtyping is equivalent to subtyping for these types (and likely others).
28261
+ // TODO(jakebailey): what other things can we quickly check here?
28259
28262
if (t.flags & TypeFlags.Unit && c.flags & TypeFlags.Unit) return neverType;
28260
28263
28261
28264
if (isTypeSubtypeOf(t, c)) return t;
You can’t perform that action at this time.
0 commit comments