@@ -188,7 +188,7 @@ finally {}
188
188
body: (statement_block)
189
189
handler: (catch_clause
190
190
parameter: (identifier)
191
- type: (type_annotation (type_identifier ))
191
+ type: (type_annotation (predefined_type ))
192
192
body: (statement_block)
193
193
)
194
194
finalizer: (finally_clause body: (statement_block))
@@ -620,7 +620,14 @@ class Foo {
620
620
(identifier)
621
621
(type_annotation (function_type
622
622
(formal_parameters)
623
- (union_type (type_identifier) (generic_type (type_identifier) (type_arguments (union_type (type_identifier) (type_identifier))))))))
623
+ (union_type
624
+ (type_identifier)
625
+ (generic_type
626
+ (type_identifier)
627
+ (type_arguments
628
+ (union_type
629
+ (type_identifier)
630
+ (literal_type (undefined)))))))))
624
631
(optional_parameter
625
632
(identifier)
626
633
(type_annotation (function_type
@@ -877,3 +884,144 @@ export interface I { }
877
884
(export_statement (class_declaration (type_identifier) (class_body)))
878
885
(export_statement (interface_declaration (type_identifier) (object_type)))
879
886
(export_statement (interface_declaration (type_identifier) (object_type))))
887
+
888
+ =======================================
889
+ Classes with generic parameters
890
+ =======================================
891
+
892
+ class A<
893
+ B,
894
+ C,
895
+ > {}
896
+
897
+ class D extends A<
898
+ X,
899
+ Y,
900
+ > {}
901
+
902
+ ---
903
+
904
+ (program
905
+ (class_declaration
906
+ (type_identifier)
907
+ (type_parameters (type_parameter (type_identifier)) (type_parameter (type_identifier)))
908
+ (class_body))
909
+ (class_declaration
910
+ (type_identifier)
911
+ (class_heritage (extends_clause (generic_type
912
+ (type_identifier)
913
+ (type_arguments (type_identifier) (type_identifier)))))
914
+ (class_body)))
915
+
916
+ =======================================
917
+ Classes with extensions
918
+ =======================================
919
+
920
+ class A extends B<C>(D) implements C {}
921
+ export class A extends B<C>(D) implements C {}
922
+
923
+ class A extends B<C>(D)<E> implements C {}
924
+ export class A extends B<C>(D)<E> implements C {}
925
+
926
+ export class A extends B<C, D> implements C {}
927
+
928
+ ---
929
+
930
+ (program
931
+ (class_declaration
932
+ (type_identifier)
933
+ (class_heritage
934
+ (extends_clause
935
+ (functional_extension
936
+ (generic_type
937
+ (type_identifier)
938
+ (type_arguments
939
+ (type_identifier)))
940
+ (arguments
941
+ (identifier))))
942
+ (implements_clause
943
+ (type_identifier)))
944
+ (class_body))
945
+ (export_statement
946
+ (class_declaration
947
+ (type_identifier)
948
+ (class_heritage
949
+ (extends_clause
950
+ (functional_extension
951
+ (generic_type
952
+ (type_identifier)
953
+ (type_arguments
954
+ (type_identifier)))
955
+ (arguments
956
+ (identifier))))
957
+ (implements_clause
958
+ (type_identifier)))
959
+ (class_body)))
960
+ (class_declaration
961
+ (type_identifier)
962
+ (class_heritage
963
+ (extends_clause
964
+ (functional_extension
965
+ (generic_type
966
+ (type_identifier)
967
+ (type_arguments
968
+ (type_identifier)))
969
+ (arguments
970
+ (identifier))
971
+ (type_arguments
972
+ (type_identifier))))
973
+ (implements_clause
974
+ (type_identifier)))
975
+ (class_body))
976
+ (export_statement
977
+ (class_declaration
978
+ (type_identifier)
979
+ (class_heritage
980
+ (extends_clause
981
+ (functional_extension
982
+ (generic_type
983
+ (type_identifier)
984
+ (type_arguments
985
+ (type_identifier)))
986
+ (arguments
987
+ (identifier))
988
+ (type_arguments
989
+ (type_identifier))))
990
+ (implements_clause
991
+ (type_identifier)))
992
+ (class_body)))
993
+ (export_statement
994
+ (class_declaration
995
+ (type_identifier)
996
+ (class_heritage
997
+ (extends_clause
998
+ (generic_type
999
+ (type_identifier)
1000
+ (type_arguments
1001
+ (type_identifier)
1002
+ (type_identifier))))
1003
+ (implements_clause
1004
+ (type_identifier)))
1005
+ (class_body))))
1006
+
1007
+ ==========================================================================
1008
+ Semicolon is not automatically inserted for method definitions with a body
1009
+ ==========================================================================
1010
+
1011
+ class Foo {
1012
+ public bar()
1013
+ {
1014
+ }
1015
+ }
1016
+
1017
+ ---
1018
+
1019
+ (program
1020
+ (class_declaration
1021
+ (type_identifier)
1022
+ (class_body
1023
+ (method_definition
1024
+ (accessibility_modifier)
1025
+ (property_identifier)
1026
+ (formal_parameters)
1027
+ (statement_block)))))
0 commit comments