File: didYouMeanStringLiteral.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (20 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
tests/cases/compiler/didYouMeanStringLiteral.ts(5,7): error TS2820: Type '"strong"' is not assignable to type 'T1'. Did you mean '"string"'?
tests/cases/compiler/didYouMeanStringLiteral.ts(6,7): error TS2322: Type '"strong"' is not assignable to type '"number" | "boolean"'.
tests/cases/compiler/didYouMeanStringLiteral.ts(7,7): error TS2820: Type '"strong"' is not assignable to type '"string" | "boolean"'. Did you mean '"string"'?


==== tests/cases/compiler/didYouMeanStringLiteral.ts (3 errors) ====
    type T1 = "string" | "number" | "boolean";
    type T2 = T1 & ("number" | "boolean"); // "number" | "boolean"
    type T3 = T1 & ("string" | "boolean"); // "string" | "boolean"
    
    const t1: T1 = "strong";
          ~~
!!! error TS2820: Type '"strong"' is not assignable to type 'T1'. Did you mean '"string"'?
    const t2: T2 = "strong";
          ~~
!!! error TS2322: Type '"strong"' is not assignable to type '"number" | "boolean"'.
    const t3: T3 = "strong";
          ~~
!!! error TS2820: Type '"strong"' is not assignable to type '"string" | "boolean"'. Did you mean '"string"'?