@@ -571,7 +571,8 @@ module private ParserImpl =
571
571
| UnknownType None ->
572
572
nodeWarn ctx nd " type not specified for field '%s '" ( getText nd.name)
573
573
| _ -> ()
574
- let fl = { name = name; isOptional = false ; value = ty }
574
+ let isOptional = nd.questionToken |> Option.isSome
575
+ let fl = { name = name; isOptional = isOptional; value = ty }
575
576
attr, Field ( fl, ( if isReadOnly nd.modifiers then ReadOnly else Mutable))
576
577
| None ->
577
578
match getPropertyExpression nd.name with
@@ -590,7 +591,8 @@ module private ParserImpl =
590
591
| UnknownType None ->
591
592
nodeWarn ctx nd " type not specified for field '%s '" ( getText nd.name)
592
593
| _ -> ()
593
- let fl = { name = name; isOptional = false ; value = ty }
594
+ let isOptional = nd.questionToken |> Option.isSome
595
+ let fl = { name = name; isOptional = isOptional; value = ty }
594
596
attr, Field ( fl, ( if isReadOnly nd.modifiers then ReadOnly else Mutable))
595
597
| None -> nodeWarn ctx nd " unsupported property name '%s ' in PropertyDeclaration" ( getText nd.name); ( attr, UnknownMember ( Some ( getText nd)))
596
598
| Kind.CallSignature ->
@@ -640,7 +642,8 @@ module private ParserImpl =
640
642
| Some name ->
641
643
let localTyprm , ty = extractType nd
642
644
if not ( List.isEmpty localTyprm) then nodeWarn ctx nd " getter with type argument is not supported"
643
- let fl = { name = name; isOptional = false ; value = ty }
645
+ let isOptional = nd.questionToken |> Option.isSome
646
+ let fl = { name = name; isOptional = isOptional; value = ty }
644
647
attr, Getter fl
645
648
| None -> nodeWarn ctx nd " unsupported property name '%s ' in GetAccessor" ( getText nd.name); ( attr, UnknownMember ( Some ( getText nd)))
646
649
| Kind.SetAccessor ->
0 commit comments