From: Jérémie Astor Date: Tue, 31 Mar 2020 10:46:34 +0000 (+0200) Subject: :art: Few fixes (examples + repeat error) X-Git-Tag: nightly~1726^2~15 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=ea025ea5e774f468894adce92fbd696b03e8045e;p=gwion.git :art: Few fixes (examples + repeat error) --- diff --git a/src/parse/check.c b/src/parse/check.c index 8f85e330..2fc064d9 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -982,7 +982,9 @@ ANN static m_bool do_stmt_auto(const Env env, const Stmt_Auto stmt) { ANN static inline m_bool cond_type(const Env env, const Exp e) { const Type t_int = env->gwion->type[et_int]; - return check_implicit(env, e, t_int); + if(check_implicit(env, e, t_int)) + ERR_B(e->pos, _("invalid condition type")) + return GW_OK; } #define stmt_func_xxx(name, type, prolog, exp) describe_stmt_func(check, name, type, prolog, exp) diff --git a/tests/error/UgenConnectException.gw b/tests/error/UgenConnectException.gw index d615209d..81faa9a9 100644 --- a/tests/error/UgenConnectException.gw +++ b/tests/error/UgenConnectException.gw @@ -1 +1 @@ -Gain @ g => dac; +Gain ref g => dac; diff --git a/tests/error/ptr_no_match.gw b/tests/error/ptr_no_match.gw index 00258008..d0818146 100644 --- a/tests/error/ptr_no_match.gw +++ b/tests/error/ptr_no_match.gw @@ -4,4 +4,4 @@ fun void test(float f){} typedef void Test(); Test t; -test @=> t; +test @=> t; diff --git a/tests/fptr/class_ptr2.gw b/tests/fptr/class_ptr2.gw index dd64e231..5bcd7954 100644 --- a/tests/fptr/class_ptr2.gw +++ b/tests/fptr/class_ptr2.gw @@ -1,8 +1,7 @@ class C { fun void test(int i) { <<< "int arg" >>>; } typedef void PtrType(int i); - test @=> - static PtrType p; + test @=> static PtrType p; p(1); test @=> p; p(1); diff --git a/tests/fptr/class_ptr3.gw b/tests/fptr/class_ptr3.gw index 524df8d6..d1ed9ee6 100644 --- a/tests/fptr/class_ptr3.gw +++ b/tests/fptr/class_ptr3.gw @@ -1,8 +1,7 @@ class C { fun static void test(int i) { <<< "int arg" >>>; } typedef static void PtrType(int i); - test @=> - static PtrType p; + test @=> static PtrType p; p(1); test @=> p; p(1); diff --git a/tests/fptr/class_ptr31.gw b/tests/fptr/class_ptr31.gw index f09a5a01..6c9a1571 100644 --- a/tests/fptr/class_ptr31.gw +++ b/tests/fptr/class_ptr31.gw @@ -2,8 +2,7 @@ class C { fun void test(int i) { <<< "int arg" >>>; } typedef static void PtrType(int i); - test @=> - static PtrType p; + test @=> static PtrType p; p(1); test @=> p; p(1); diff --git a/tests/import/core.916363 b/tests/import/core.916363 new file mode 100644 index 00000000..45b63ea6 Binary files /dev/null and b/tests/import/core.916363 differ diff --git a/tests/new/lambda2.gw b/tests/new/lambda2.gw index 0ad67254..7414ab6c 100644 --- a/tests/new/lambda2.gw +++ b/tests/new/lambda2.gw @@ -1,7 +1,6 @@ class C { typedef void ptr_t(int i); -\a { <<< this, " ", a >>>; } @=> -ptr_t ptr; +\a { <<< this, " ", a >>>; } @=> ptr_t ptr; #!ptr(3); fun void t1(int i) { <<< this, " t1 ", i >>>; } fun void test(ptr_t ptr) { diff --git a/tests/new/ref.gw b/tests/new/ref.gw index 72d689a2..8923bf10 100644 --- a/tests/new/ref.gw +++ b/tests/new/ref.gw @@ -1 +1 @@ -new Object @=> Object !o; +new Object @=> Object nonnull o; diff --git a/tests/tree/class_multi_ref_decl.gw b/tests/tree/class_multi_ref_decl.gw index ce6d5dfc..440e4ad3 100644 --- a/tests/tree/class_multi_ref_decl.gw +++ b/tests/tree/class_multi_ref_decl.gw @@ -1,4 +1,4 @@ class C { - Object @ i, a; + Object ref i, a; } diff --git a/tests/tree/class_simple_ref_decl.gw b/tests/tree/class_simple_ref_decl.gw index f614771a..7610b45b 100644 --- a/tests/tree/class_simple_ref_decl.gw +++ b/tests/tree/class_simple_ref_decl.gw @@ -1,4 +1,4 @@ class C { - Object @ o; + Object ref o; } diff --git a/tests/tree/multi_ref_decl.gw b/tests/tree/multi_ref_decl.gw index 24a15cf4..b0555aaa 100644 --- a/tests/tree/multi_ref_decl.gw +++ b/tests/tree/multi_ref_decl.gw @@ -1,2 +1,2 @@ -Object @ i, a; +Object ref i, a; <<< i, a >>>; diff --git a/tests/tree/set_obj.gw b/tests/tree/set_obj.gw index 06a52846..043de2bc 100644 --- a/tests/tree/set_obj.gw +++ b/tests/tree/set_obj.gw @@ -1,4 +1,4 @@ typedef int[2]Type; -Type!type; +Type nonnull type; <<>>; for(auto ref a : type); diff --git a/tests/tree/simple_ref_decl.gw b/tests/tree/simple_ref_decl.gw index e92148e4..f4aa262f 100644 --- a/tests/tree/simple_ref_decl.gw +++ b/tests/tree/simple_ref_decl.gw @@ -1,2 +1,2 @@ -Object @ o; +Object ref o; <<< o >>>;