Skip to content

Commit 3a33a25

Browse files
author
Willem Wyndham
authored
fix: Make warning 232 pedantic (#1986)
1 parent 1958554 commit 3a33a25

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/compiler.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -799,10 +799,12 @@ export class Compiler extends DiagnosticEmitter {
799799
this.ensureModuleExport(instanceName, instance, prefix);
800800
}
801801
} else if (functionPrototype.is(CommonFlags.GENERIC)) {
802-
this.warning(
803-
DiagnosticCode.Exported_generic_function_or_class_has_no_concrete_instances,
804-
functionPrototype.identifierNode.range
805-
);
802+
if (this.options.pedantic) {
803+
this.pedantic(
804+
DiagnosticCode.Exported_generic_function_or_class_has_no_concrete_instances,
805+
functionPrototype.identifierNode.range
806+
);
807+
}
806808
}
807809
break;
808810
}
@@ -821,10 +823,12 @@ export class Compiler extends DiagnosticEmitter {
821823
this.ensureModuleExport(instanceName, instance, prefix);
822824
}
823825
} else if (classPrototype.is(CommonFlags.GENERIC)) {
824-
this.warning(
825-
DiagnosticCode.Exported_generic_function_or_class_has_no_concrete_instances,
826-
classPrototype.identifierNode.range
827-
);
826+
if (this.options.pedantic) {
827+
this.pedantic(
828+
DiagnosticCode.Exported_generic_function_or_class_has_no_concrete_instances,
829+
classPrototype.identifierNode.range
830+
);
831+
}
828832
}
829833
break;
830834
}

tests/compiler/export-generic.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"asc_flags": [
3+
"--pedantic"
34
],
45
"stderr": [
56
"AS232: Exported generic function or class has no concrete instances.",

0 commit comments

Comments
 (0)