Skip to content

Commit

Permalink
new op overload error case unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gewang committed Oct 1, 2023
1 parent c2554d5 commit 730e024
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/06-Errors/error-op-overload-child-1.ck
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// test: this should compiler error, since SinOsc is a child of UGen
// and => is already defined for UGen => UGen
fun void @operator =>( SinOsc lhs, SinOsc rhs )
{
<<< "cannot get here" >>>;
}
3 changes: 3 additions & 0 deletions src/test/06-Errors/error-op-overload-child-1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
error-op-overload-child-1.ck:3:20: error: binary operator '=>' already overloaded on types 'SinOsc' and 'SinOsc' (or their parents)...
[3] fun void @operator =>( SinOsc lhs, SinOsc rhs )
^
6 changes: 6 additions & 0 deletions src/test/06-Errors/error-op-overload-child-2.ck
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// test: this should compiler error, since SinOsc and NRev are
// children of UGen and => is already defined for UGen => UGen
fun void @operator =>( SinOsc lhs, NRev rhs )
{
<<< "cannot get here" >>>;
}
3 changes: 3 additions & 0 deletions src/test/06-Errors/error-op-overload-child-2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
error-op-overload-child-2.ck:3:20: error: binary operator '=>' already overloaded on types 'SinOsc' and 'NRev' (or their parents)...
[3] fun void @operator =>( SinOsc lhs, NRev rhs )
^

0 comments on commit 730e024

Please sign in to comment.