aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2024-06-24 11:46:43 +0200
committerBad Diode <bd@badd10de.dev>2024-06-24 11:46:43 +0200
commit9c73b54a747e5489b2d6f27947cd8216f5311d5e (patch)
tree1a6aa027e80336cd3418305bcb8402ef47bbedf2 /tests
parent15e24115a2a117407157c993fe17b2d414dc0bf4 (diff)
downloadbdl-9c73b54a747e5489b2d6f27947cd8216f5311d5e.tar.gz
bdl-9c73b54a747e5489b2d6f27947cd8216f5311d5e.zip
Typecheck return values in the entire function body
Diffstat (limited to 'tests')
-rw-r--r--tests/semantics.bad6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/semantics.bad b/tests/semantics.bad
index 5071d8b..518ef40 100644
--- a/tests/semantics.bad
+++ b/tests/semantics.bad
@@ -109,7 +109,11 @@
109; let c = 1 109; let c = 1
110; 1 + 1 + c 110; 1 + 1 + c
111; } 111; }
112fun foo(a: int b: str): (f32, f64) { 112fun foo(a: int b: str): (f64, f64) {
113 if (a == 1) {
114 ; return("test", b)
115 return(3.0, 4.0)
116 }
113 return(1.0, 2.0) 117 return(1.0, 2.0)
114} 118}
115 119