From: fennecdjay Date: Thu, 8 Aug 2019 13:57:21 +0000 (+0200) Subject: :art: Forbid tuple acces by member X-Git-Tag: nightly~2295 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=a36f40afd7475e71273b3151d181522061b29bb9;p=gwion.git :art: Forbid tuple acces by member --- diff --git a/src/parse/tuple.c b/src/parse/tuple.c index 38b88ea2..6edb2e17 100644 --- a/src/parse/tuple.c +++ b/src/parse/tuple.c @@ -41,7 +41,7 @@ ANN Type tuple_type(const Env env, const Vector v, const loc_t pos) { Type_List tlbase = NULL, tl = NULL; for(m_uint i = 0; i < vector_size(v); ++i) { char name[num_digit(i) + 2]; - sprintf(name, "e%lu", i); + sprintf(name, "@e%lu", i); const Symbol sym = insert_symbol(name); const Type t = (Type)vector_at(v, i); const Symbol tsym = insert_symbol(t != 1 ? t->name : "@Undefined"); diff --git a/tests/tuple/object2tuple.gw b/tests/tuple/object2tuple.gw index 4bb432e3..d62b0534 100644 --- a/tests/tuple/object2tuple.gw +++ b/tests/tuple/object2tuple.gw @@ -4,5 +4,5 @@ class Person { } Person p @=> <~string,int~>Tuple @t; -<<>>; -<<>>; +<<>>; +<<>>; diff --git a/tests/tuple/object2tuple_err.gw b/tests/tuple/object2tuple_err.gw index 525c774e..78d6554c 100644 --- a/tests/tuple/object2tuple_err.gw +++ b/tests/tuple/object2tuple_err.gw @@ -4,5 +4,5 @@ class Person { } Person p @=> <~string,string~>Tuple @t; -<<>>; -<<>>; +<<>>; +<<>>; diff --git a/tests/tuple/tuple_implicit.gw b/tests/tuple/tuple_implicit.gw index c589d309..419a94ee 100644 --- a/tests/tuple/tuple_implicit.gw +++ b/tests/tuple/tuple_implicit.gw @@ -1,6 +1,5 @@ #! [contains] Tom fun void test(<~string~>Tuple t) { -#! <<< t.e0 >>>; <<< t[0] >>>; }