Skip to content

Commit

Permalink
Invalid comparison throws Incomparable_Values rather than Type_Error
Browse files Browse the repository at this point in the history
  • Loading branch information
Akirathan committed Apr 16, 2023
1 parent 8718c99 commit 1f23d83
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ boolean doBigInteger(EnsoBigInteger self, EnsoBigInteger that) {
@Fallback
DataflowError doOther(EnsoBigInteger self, Object that) {
var builtins = EnsoContext.get(this).getBuiltins();
var typeError = builtins.error().makeTypeError(builtins.number().getNumber(), that, "that");
return DataflowError.withoutTrace(typeError, this);
var incomparableValsErr = builtins.error().makeIncomparableValues(self, that);
return DataflowError.withoutTrace(incomparableValsErr, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ boolean doBigInteger(EnsoBigInteger self, EnsoBigInteger that) {
@Fallback
DataflowError doOther(EnsoBigInteger self, Object that) {
var builtins = EnsoContext.get(this).getBuiltins();
var typeError = builtins.error().makeTypeError(builtins.number().getNumber(), that, "that");
return DataflowError.withoutTrace(typeError, this);
var incomparableValsErr = builtins.error().makeIncomparableValues(self, that);
return DataflowError.withoutTrace(incomparableValsErr, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ boolean doBigInteger(EnsoBigInteger self, EnsoBigInteger that) {
@Fallback
DataflowError doOther(EnsoBigInteger self, Object that) {
var builtins = EnsoContext.get(this).getBuiltins();
var typeError = builtins.error().makeTypeError(builtins.number().getNumber(), that, "that");
return DataflowError.withoutTrace(typeError, this);
var incomparableValsErr = builtins.error().makeIncomparableValues(self, that);
return DataflowError.withoutTrace(incomparableValsErr, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ boolean doBigInteger(EnsoBigInteger self, EnsoBigInteger that) {
@Fallback
DataflowError doOther(EnsoBigInteger self, Object that) {
var builtins = EnsoContext.get(this).getBuiltins();
var typeError = builtins.error().makeTypeError(builtins.number().getNumber(), that, "that");
return DataflowError.withoutTrace(typeError, this);
var incomparableValsErr = builtins.error().makeIncomparableValues(self, that);
return DataflowError.withoutTrace(incomparableValsErr, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ boolean doBigInteger(double self, EnsoBigInteger that) {
@Fallback
DataflowError doOther(double self, Object that) {
var builtins = EnsoContext.get(this).getBuiltins();
var typeError = builtins.error().makeTypeError(builtins.number().getNumber(), that, "that");
return DataflowError.withoutTrace(typeError, this);
var incomparableValsErr = builtins.error().makeIncomparableValues(self, that);
return DataflowError.withoutTrace(incomparableValsErr, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ boolean doBigInteger(double self, EnsoBigInteger that) {
@Fallback
DataflowError doOther(double self, Object that) {
var builtins = EnsoContext.get(this).getBuiltins();
var typeError = builtins.error().makeTypeError(builtins.number().getNumber(), that, "that");
return DataflowError.withoutTrace(typeError, this);
var incomparableValsErr = builtins.error().makeIncomparableValues(self, that);
return DataflowError.withoutTrace(incomparableValsErr, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ boolean doBigInteger(double self, EnsoBigInteger that) {
@Fallback
DataflowError doOther(double self, Object that) {
var builtins = EnsoContext.get(this).getBuiltins();
var typeError = builtins.error().makeTypeError(builtins.number().getNumber(), that, "that");
return DataflowError.withoutTrace(typeError, this);
var incomparableValsErr = builtins.error().makeIncomparableValues(self, that);
return DataflowError.withoutTrace(incomparableValsErr, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ boolean doBigInteger(double self, EnsoBigInteger that) {
@Fallback
DataflowError doOther(double self, Object that) {
var builtins = EnsoContext.get(this).getBuiltins();
var typeError = builtins.error().makeTypeError(builtins.number().getNumber(), that, "that");
return DataflowError.withoutTrace(typeError, this);
var incomparableValsErr = builtins.error().makeIncomparableValues(self, that);
return DataflowError.withoutTrace(incomparableValsErr, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ boolean doBigInteger(long self, EnsoBigInteger that) {
@Fallback
DataflowError doOther(long self, Object that) {
var builtins = EnsoContext.get(this).getBuiltins();
var typeError = builtins.error().makeTypeError(builtins.number().getNumber(), that, "that");
return DataflowError.withoutTrace(typeError, this);
var incomparableValsErr = builtins.error().makeIncomparableValues(self, that);
return DataflowError.withoutTrace(incomparableValsErr, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ boolean doBigInteger(long self, EnsoBigInteger that) {
@Fallback
DataflowError doOther(long self, Object that) {
var builtins = EnsoContext.get(this).getBuiltins();
var typeError = builtins.error().makeTypeError(builtins.number().getNumber(), that, "that");
return DataflowError.withoutTrace(typeError, this);
var incomparableValsErr = builtins.error().makeIncomparableValues(self, that);
return DataflowError.withoutTrace(incomparableValsErr, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ boolean doBigInteger(long self, EnsoBigInteger that) {
@Fallback
DataflowError doOther(long self, Object that) {
var builtins = EnsoContext.get(this).getBuiltins();
var typeError = builtins.error().makeTypeError(builtins.number().getNumber(), that, "that");
return DataflowError.withoutTrace(typeError, this);
var incomparableValsErr = builtins.error().makeIncomparableValues(self, that);
return DataflowError.withoutTrace(incomparableValsErr, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ boolean doBigInteger(long self, EnsoBigInteger that) {
@Fallback
DataflowError doOther(long self, Object that) {
var builtins = EnsoContext.get(this).getBuiltins();
var typeError = builtins.error().makeTypeError(builtins.number().getNumber(), that, "that");
return DataflowError.withoutTrace(typeError, this);
var incomparableValsErr = builtins.error().makeIncomparableValues(self, that);
return DataflowError.withoutTrace(incomparableValsErr, this);
}
}

0 comments on commit 1f23d83

Please sign in to comment.