Skip to content

Commit 1ccb190

Browse files
committed
Add tests covering remaining failing coercions.
1 parent c3795a6 commit 1ccb190

4 files changed

Lines changed: 28 additions & 0 deletions

File tree

test/coerceIntLengthMismatch.slq

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
def main(){
3+
n:=2,m:=3;
4+
x:=0:int[n];
5+
y:=x coerce int[m]; // error
6+
// (need to go through vector)
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
def main(){
3+
n:=2,m:=3;
4+
x:=0:int[n];
5+
y:=x coerce 𝔹^m; // TODO: crash at runtime
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// args: --run
2+
3+
def main(){
4+
n:=2,m:=3;
5+
x:=vector(n,0:𝔹);
6+
y:=x coerce int[m]; // error
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// args: --run
2+
3+
def main(){
4+
n:=2;
5+
x:=vector(n,0:!𝔹);
6+
m:=3;
7+
y:=x coerce !𝔹^m; // error
8+
}

0 commit comments

Comments
 (0)