diff --git a/src/compiler.ts b/src/compiler.ts index 4128944f4b..9952dce23e 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -799,10 +799,12 @@ export class Compiler extends DiagnosticEmitter { this.ensureModuleExport(instanceName, instance, prefix); } } else if (functionPrototype.is(CommonFlags.GENERIC)) { - this.warning( - DiagnosticCode.Exported_generic_function_or_class_has_no_concrete_instances, - functionPrototype.identifierNode.range - ); + if (this.options.pedantic) { + this.pedantic( + DiagnosticCode.Exported_generic_function_or_class_has_no_concrete_instances, + functionPrototype.identifierNode.range + ); + } } break; } @@ -821,10 +823,12 @@ export class Compiler extends DiagnosticEmitter { this.ensureModuleExport(instanceName, instance, prefix); } } else if (classPrototype.is(CommonFlags.GENERIC)) { - this.warning( - DiagnosticCode.Exported_generic_function_or_class_has_no_concrete_instances, - classPrototype.identifierNode.range - ); + if (this.options.pedantic) { + this.pedantic( + DiagnosticCode.Exported_generic_function_or_class_has_no_concrete_instances, + classPrototype.identifierNode.range + ); + } } break; } diff --git a/tests/compiler/export-generic.json b/tests/compiler/export-generic.json index 92e8dd2763..9df2db436e 100644 --- a/tests/compiler/export-generic.json +++ b/tests/compiler/export-generic.json @@ -1,5 +1,6 @@ { "asc_flags": [ + "--pedantic" ], "stderr": [ "AS232: Exported generic function or class has no concrete instances.",