質問編集履歴

1

補足説明

2022/01/04 01:26

投稿

yochun02
yochun02

スコア76

test CHANGED
File without changes
test CHANGED
@@ -44,8 +44,20 @@
44
44
 
45
45
 
46
46
 
47
+
48
+
49
+ /* Property 'num' does not exist on type 'TypeA | TypeB'.
50
+
51
+ Property 'num' does not exist on type 'TypeB' */
52
+
47
53
  console.log(selectType('A')?.num) // error -> 期待値: 1
54
+
55
+
48
56
 
49
57
  console.log(selectType('B')?.str) // error -> 期待値: hoge
50
58
 
59
+
60
+
61
+
62
+
51
63
  ```