Skip to content

Add argument to not implemented error message #1294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/builtins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2838,7 +2838,7 @@ function builtin_assert(ctx: BuiltinContext): ExpressionRef {
}
}
compiler.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
ctx.reportNode.typeArgumentsRange
);
return abort;
Expand Down
37 changes: 19 additions & 18 deletions src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2107,7 +2107,7 @@ export class Compiler extends DiagnosticEmitter {
case NodeKind.TYPEDECLARATION: {
// TODO: integrate inner type declaration into flow
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
statement.range
);
stmt = module.unreachable();
Expand Down Expand Up @@ -2182,7 +2182,7 @@ export class Compiler extends DiagnosticEmitter {
var labelNode = statement.label;
if (labelNode) {
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
labelNode.range
);
return module.unreachable();
Expand Down Expand Up @@ -2216,7 +2216,7 @@ export class Compiler extends DiagnosticEmitter {
var label = statement.label;
if (label) {
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
label.range
);
return module.unreachable();
Expand Down Expand Up @@ -2581,7 +2581,7 @@ export class Compiler extends DiagnosticEmitter {
statement: ForOfStatement
): ExpressionRef {
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
statement.range
);
return this.module.unreachable();
Expand Down Expand Up @@ -2915,8 +2915,9 @@ export class Compiler extends DiagnosticEmitter {
// TODO: can't yet support something like: try { return ... } finally { ... }
// worthwhile to investigate lowering returns to block results (here)?
this.error(
DiagnosticCode.Not_implemented,
statement.range
DiagnosticCode.Not_implemented_0,
statement.range,
"Try Statements"
);
return this.module.unreachable();
}
Expand Down Expand Up @@ -3454,7 +3455,7 @@ export class Compiler extends DiagnosticEmitter {
}
default: {
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
expression.range
);
expr = this.module.unreachable();
Expand Down Expand Up @@ -3782,7 +3783,7 @@ export class Compiler extends DiagnosticEmitter {
// }
// }
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
expression.range
);
return this.module.unreachable();
Expand Down Expand Up @@ -4312,7 +4313,7 @@ export class Compiler extends DiagnosticEmitter {
case TypeKind.ANYREF: {
// TODO: ref.eq
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
expression.range
);
expr = module.unreachable();
Expand Down Expand Up @@ -4412,7 +4413,7 @@ export class Compiler extends DiagnosticEmitter {
case TypeKind.ANYREF: {
// TODO: !ref.eq
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
expression.range
);
expr = module.unreachable();
Expand Down Expand Up @@ -5951,7 +5952,7 @@ export class Compiler extends DiagnosticEmitter {
}
default: {
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
expression.range
);
return this.module.unreachable();
Expand Down Expand Up @@ -6155,7 +6156,7 @@ export class Compiler extends DiagnosticEmitter {
}
}
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
valueExpression.range
);
return module.unreachable();
Expand Down Expand Up @@ -6628,7 +6629,7 @@ export class Compiler extends DiagnosticEmitter {
));
}
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
expression.expression.range
);
return this.module.unreachable();
Expand Down Expand Up @@ -6659,7 +6660,7 @@ export class Compiler extends DiagnosticEmitter {
var hasRest = signature.hasRest;
if (hasRest) {
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
reportNode.range
);
return false;
Expand Down Expand Up @@ -8148,7 +8149,7 @@ export class Compiler extends DiagnosticEmitter {
if (target.parent != flow.parentFunction) {
// TODO: closures
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
expression.range
);
return module.unreachable();
Expand Down Expand Up @@ -8213,7 +8214,7 @@ export class Compiler extends DiagnosticEmitter {
}
}
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
expression.range
);
return this.module.unreachable();
Expand Down Expand Up @@ -8468,7 +8469,7 @@ export class Compiler extends DiagnosticEmitter {
// case LiteralKind.REGEXP:
}
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
expression.range
);
this.currentType = contextualType;
Expand Down Expand Up @@ -9319,7 +9320,7 @@ export class Compiler extends DiagnosticEmitter {
}
}
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
expression.range
);
return module.unreachable();
Expand Down
4 changes: 2 additions & 2 deletions src/diagnosticMessages.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/** Enum of available diagnostic codes. */
export enum DiagnosticCode {
Not_implemented = 100,
Not_implemented_0 = 100,
Operation_is_unsafe = 101,
User_defined_0 = 102,
Feature_0_is_not_enabled = 103,
Expand Down Expand Up @@ -180,7 +180,7 @@ export enum DiagnosticCode {
/** Translates a diagnostic code to its respective string. */
export function diagnosticCodeToString(code: DiagnosticCode): string {
switch (code) {
case 100: return "Not implemented.";
case 100: return "Not implemented: {0}";
case 101: return "Operation is unsafe.";
case 102: return "User-defined: {0}";
case 103: return "Feature '{0}' is not enabled.";
Expand Down
2 changes: 1 addition & 1 deletion src/diagnosticMessages.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Not implemented.": 100,
"Not implemented: {0}": 100,
"Operation is unsafe.": 101,
"User-defined: {0}": 102,
"Feature '{0}' is not enabled.": 103,
Expand Down
2 changes: 1 addition & 1 deletion src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2606,7 +2606,7 @@ export class Parser extends DiagnosticEmitter {
if (tn.skip(Token.COMMA)) {
// TODO: default + star, default + members
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
tn.range()
);
return null;
Expand Down
12 changes: 6 additions & 6 deletions src/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ export class Resolver extends DiagnosticEmitter {
}
if (reportMode == ReportMode.REPORT) {
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
node.range
);
}
Expand Down Expand Up @@ -1160,7 +1160,7 @@ export class Resolver extends DiagnosticEmitter {
}
if (reportMode == ReportMode.REPORT) {
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
node.range
);
}
Expand Down Expand Up @@ -1658,7 +1658,7 @@ export class Resolver extends DiagnosticEmitter {
// return this.resolveClass(this.program.readonlyArrayPrototype, [ elementType ]);
// }
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
node.range
);
return null;
Expand Down Expand Up @@ -1884,7 +1884,7 @@ export class Resolver extends DiagnosticEmitter {
}
if (reportMode == ReportMode.REPORT) {
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
node.range
);
}
Expand Down Expand Up @@ -2108,7 +2108,7 @@ export class Resolver extends DiagnosticEmitter {
}
if (reportMode == ReportMode.REPORT) {
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
node.range
);
}
Expand Down Expand Up @@ -2318,7 +2318,7 @@ export class Resolver extends DiagnosticEmitter {
}
if (reportMode == ReportMode.REPORT) {
this.error(
DiagnosticCode.Not_implemented,
DiagnosticCode.Not_implemented_0,
node.range
);
}
Expand Down