• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#  Indexed access types are not supported
2
3Rule ``arkts-no-aliases-by-index``
4
5**Severity: error**
6
7ArkTS does not support indexed access types. Use the type name instead.
8
9
10## TypeScript
11
12
13```
14
15    type Point = {x: number, y: number}
16    type N = Point["x"] // is equal to number
17
18```
19
20## ArkTS
21
22
23```
24
25    class Point {x: number = 0; y: number = 0}
26    type N = number
27
28```
29
30
31