Skip to content

Commit efd8a89

Browse files
committed
Diagnostics for decorators
1 parent fb7dd52 commit efd8a89

10 files changed

+1786
-1529
lines changed

src/compiler/diagnosticInformationMap.generated.ts

+5
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ module ts {
162162
Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_or_import_d_from_mod_instead: { code: 1202, category: DiagnosticCategory.Error, key: "Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"' or 'import d from \"mod\"' instead." },
163163
Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead: { code: 1203, category: DiagnosticCategory.Error, key: "Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead." },
164164
Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher: { code: 1204, category: DiagnosticCategory.Error, key: "Cannot compile external modules into amd or commonjs when targeting es6 or higher." },
165+
Decorators_are_only_supported_on_class_members_when_targeting_ECMAScript_5_or_higher: { code: 1205, category: DiagnosticCategory.Error, key: "Decorators are only supported on class members when targeting ECMAScript 5 or higher." },
166+
Decorators_are_not_valid_on_this_declaration_type: { code: 1206, category: DiagnosticCategory.Error, key: "Decorators are not valid on this declaration type." },
167+
Argument_to_ambient_decorator_must_be_constant_expression: { code: 1207, category: DiagnosticCategory.Error, key: "Argument to ambient decorator must be constant expression." },
168+
Decorators_may_not_change_the_type_of_a_member: { code: 1208, category: DiagnosticCategory.Error, key: "Decorators may not change the type of a member." },
169+
Decorators_may_not_change_the_type_of_a_class: { code: 1209, category: DiagnosticCategory.Error, key: "Decorators may not change the type of a class." },
165170
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
166171
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." },
167172
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },

src/compiler/diagnosticMessages.json

+20
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,26 @@
639639
"category": "Error",
640640
"code": 1204
641641
},
642+
"Decorators are only supported on class members when targeting ECMAScript 5 or higher.": {
643+
"category": "Error",
644+
"code": 1205
645+
},
646+
"Decorators are not valid on this declaration type.": {
647+
"category": "Error",
648+
"code": 1206
649+
},
650+
"Argument to ambient decorator must be constant expression.": {
651+
"category": "Error",
652+
"code": 1207
653+
},
654+
"Decorators may not change the type of a member.": {
655+
"category": "Error",
656+
"code": 1208
657+
},
658+
"Decorators may not change the type of a class.": {
659+
"category": "Error",
660+
"code": 1209
661+
},
642662

643663
"Duplicate identifier '{0}'.": {
644664
"category": "Error",

0 commit comments

Comments
 (0)