@@ -66,6 +66,7 @@ export enum DiagnosticCode {
6666 Unexpected_end_of_text = 1126 ,
6767 Invalid_character = 1127 ,
6868 _case_or_default_expected = 1130 ,
69+ _super_must_be_followed_by_an_argument_list_or_member_access = 1034 ,
6970 A_declare_modifier_cannot_be_used_in_an_already_ambient_context = 1038 ,
7071 Type_argument_expected = 1140 ,
7172 String_literal_expected = 1141 ,
@@ -94,13 +95,16 @@ export enum DiagnosticCode {
9495 Index_signature_is_missing_in_type_0 = 2329 ,
9596 _this_cannot_be_referenced_in_current_location = 2332 ,
9697 _super_can_only_be_referenced_in_a_derived_class = 2335 ,
98+ Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors = 2337 ,
9799 Property_0_does_not_exist_on_type_1 = 2339 ,
98100 Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures = 2349 ,
99101 Cannot_use_new_with_an_expression_whose_type_lacks_a_construct_signature = 2351 ,
100102 A_function_whose_declared_type_is_not_void_must_return_a_value = 2355 ,
101103 The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access = 2357 ,
102104 The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access = 2364 ,
103105 Operator_0_cannot_be_applied_to_types_1_and_2 = 2365 ,
106+ A_super_call_must_be_the_first_statement_in_the_constructor = 2376 ,
107+ Constructors_for_derived_classes_must_contain_a_super_call = 2377 ,
104108 _get_and_set_accessor_must_have_the_same_type = 2380 ,
105109 Constructor_implementation_is_missing = 2390 ,
106110 Function_implementation_is_missing_or_not_immediately_following_the_declaration = 2391 ,
@@ -124,7 +128,9 @@ export enum DiagnosticCode {
124128 Required_type_parameters_may_not_follow_optional_type_parameters = 2706 ,
125129 File_0_not_found = 6054 ,
126130 Numeric_separators_are_not_allowed_here = 6188 ,
127- Multiple_consecutive_numeric_separators_are_not_permitted = 6189
131+ Multiple_consecutive_numeric_separators_are_not_permitted = 6189 ,
132+ _super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class = 17009 ,
133+ _super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class = 17011
128134}
129135
130136/** Translates a diagnostic code to its respective string. */
@@ -189,6 +195,7 @@ export function diagnosticCodeToString(code: DiagnosticCode): string {
189195 case 1126 : return "Unexpected end of text." ;
190196 case 1127 : return "Invalid character." ;
191197 case 1130 : return "'case' or 'default' expected." ;
198+ case 1034 : return "'super' must be followed by an argument list or member access." ;
192199 case 1038 : return "A 'declare' modifier cannot be used in an already ambient context." ;
193200 case 1140 : return "Type argument expected." ;
194201 case 1141 : return "String literal expected." ;
@@ -217,13 +224,16 @@ export function diagnosticCodeToString(code: DiagnosticCode): string {
217224 case 2329 : return "Index signature is missing in type '{0}'." ;
218225 case 2332 : return "'this' cannot be referenced in current location." ;
219226 case 2335 : return "'super' can only be referenced in a derived class." ;
227+ case 2337 : return "Super calls are not permitted outside constructors or in nested functions inside constructors." ;
220228 case 2339 : return "Property '{0}' does not exist on type '{1}'." ;
221229 case 2349 : return "Cannot invoke an expression whose type lacks a call signature. Type '{0}' has no compatible call signatures." ;
222230 case 2351 : return "Cannot use 'new' with an expression whose type lacks a construct signature." ;
223231 case 2355 : return "A function whose declared type is not 'void' must return a value." ;
224232 case 2357 : return "The operand of an increment or decrement operator must be a variable or a property access." ;
225233 case 2364 : return "The left-hand side of an assignment expression must be a variable or a property access." ;
226234 case 2365 : return "Operator '{0}' cannot be applied to types '{1}' and '{2}'." ;
235+ case 2376 : return "A 'super' call must be the first statement in the constructor." ;
236+ case 2377 : return "Constructors for derived classes must contain a 'super' call." ;
227237 case 2380 : return "'get' and 'set' accessor must have the same type." ;
228238 case 2390 : return "Constructor implementation is missing." ;
229239 case 2391 : return "Function implementation is missing or not immediately following the declaration." ;
@@ -248,6 +258,8 @@ export function diagnosticCodeToString(code: DiagnosticCode): string {
248258 case 6054 : return "File '{0}' not found." ;
249259 case 6188 : return "Numeric separators are not allowed here." ;
250260 case 6189 : return "Multiple consecutive numeric separators are not permitted." ;
261+ case 17009 : return "'super' must be called before accessing 'this' in the constructor of a derived class." ;
262+ case 17011 : return "'super' must be called before accessing a property of 'super' in the constructor of a derived class." ;
251263 default : return "" ;
252264 }
253265}
0 commit comments