mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
73 lines
2.1 KiB
Plaintext
73 lines
2.1 KiB
Plaintext
errorOnEnumReferenceInCondition.ts(6,11): error TS2845: This condition will always return 'false'.
|
|
errorOnEnumReferenceInCondition.ts(7,11): error TS2845: This condition will always return 'true'.
|
|
errorOnEnumReferenceInCondition.ts(9,5): error TS2845: This condition will always return 'false'.
|
|
errorOnEnumReferenceInCondition.ts(17,5): error TS2845: This condition will always return 'true'.
|
|
errorOnEnumReferenceInCondition.ts(30,11): error TS2845: This condition will always return 'false'.
|
|
errorOnEnumReferenceInCondition.ts(31,11): error TS2845: This condition will always return 'true'.
|
|
errorOnEnumReferenceInCondition.ts(33,5): error TS2845: This condition will always return 'false'.
|
|
errorOnEnumReferenceInCondition.ts(41,5): error TS2845: This condition will always return 'true'.
|
|
|
|
|
|
==== errorOnEnumReferenceInCondition.ts (8 errors) ====
|
|
enum Nums {
|
|
Zero = 0,
|
|
One = 1,
|
|
}
|
|
|
|
const a = Nums.Zero ? "a" : "b";
|
|
~~~~~~~~~
|
|
!!! error TS2845: This condition will always return 'false'.
|
|
const b = Nums.One ? "a" : "b";
|
|
~~~~~~~~
|
|
!!! error TS2845: This condition will always return 'true'.
|
|
|
|
if (Nums.Zero) {
|
|
~~~~~~~~~
|
|
!!! error TS2845: This condition will always return 'false'.
|
|
Nums;
|
|
}
|
|
else {
|
|
Nums;
|
|
}
|
|
|
|
|
|
if (Nums.One) {
|
|
~~~~~~~~
|
|
!!! error TS2845: This condition will always return 'true'.
|
|
Nums;
|
|
}
|
|
else {
|
|
Nums;
|
|
}
|
|
|
|
|
|
enum Strs {
|
|
Empty = "",
|
|
A = "A",
|
|
}
|
|
|
|
const c = Strs.Empty ? "a" : "b";
|
|
~~~~~~~~~~
|
|
!!! error TS2845: This condition will always return 'false'.
|
|
const d = Strs.A ? "a" : "b";
|
|
~~~~~~
|
|
!!! error TS2845: This condition will always return 'true'.
|
|
|
|
if (Strs.Empty) {
|
|
~~~~~~~~~~
|
|
!!! error TS2845: This condition will always return 'false'.
|
|
Strs;
|
|
}
|
|
else {
|
|
Strs;
|
|
}
|
|
|
|
|
|
if (Strs.A) {
|
|
~~~~~~
|
|
!!! error TS2845: This condition will always return 'true'.
|
|
Strs;
|
|
}
|
|
else {
|
|
Strs;
|
|
} |