Skip to content

Commit

Permalink
No longer ignoreCompiler for avoidEmpty
Browse files Browse the repository at this point in the history
First alternative now throws an exception instead of return 1.
  • Loading branch information
PaulKlint committed Mar 18, 2024
1 parent 96988e8 commit 32e786b
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,9 @@ bool less(&T a, &T b) = a < b;

test bool lessIsConsistentThroughTypeParameters(num x, num y) = (x < y) ==> less(x, y);

@ignoreCompiler{How to make 1 compatible with &T?}
&T avoidEmpty(list[&T] _) { return 1; }
@ignoreCompiler{How to make 1 compatible with &T?}
&T avoidEmpty(list[&T] _) { throw "this should not happen"; }
&T avoidEmpty(list[&T] _) { throw "this should happen"; }

@ignoreCompiler{How to make 1 compatible with &T?}
test bool voidReturnIsNotAllowed() {
try {
avoidEmpty([]);
Expand Down

0 comments on commit 32e786b

Please sign in to comment.