ANN bool compat_func(const __restrict__ Func_Def,
const __restrict__ Func_Def);
ANN Type known_type(const Env env, Type_Decl *);
-ANN m_str tdpp(MemPool, SymTable*, const Type_Decl*, const bool no_color);
+ANN m_str tdpp(MemPool, SymTable*, const Type_Decl*, const bool no_color, const bool minimize);
ANN Type prim_ref(const Env env, const Type t, const Type_Decl *td);
ANN bool env_access(const Env env, const ae_flag flag, const loc_t);
ANN bool env_storage(const Env env, ae_flag flag, const loc_t);
return !array ? ret : array_type(env, ret, array->depth, td->tag.loc);
}
-ANN m_str tdpp(MemPool mp, SymTable *st, const Type_Decl *td, bool no_color) {
- struct GwfmtState ls = {};
+ANN m_str tdpp(MemPool mp, SymTable *st, const Type_Decl *td,
+ const bool no_color, const bool minimize) {
+ struct GwfmtState ls = { .minimize = minimize,};
text_init(&ls.text, mp);
Gwfmt gwfmter = {.mp = mp, .ls = &ls, .st = st };
bool has_color = tcol_has_color();
}
ANN static inline void *type_unknown(const Env env, const Type_Decl *td) {
- m_str str = tdpp(env->gwion->mp, env->gwion->st, td, false);
+ m_str str = tdpp(env->gwion->mp, env->gwion->st, td, false, tcol_has_color());
env_err(env, td->tag.loc, _("unknown type '%s'"), str);
free_mstr(env->gwion->mp, str);
return NULL;
ANN static bool sema_exp_array(Sema *a, Exp_Array *b) {
const bool ok = sema_exp(a, b->base);
+ CHECK_B(array_not_empty(a, b->array, "in array expression", exp_self(b)->loc));
return sema_array_sub(a, b->array) && ok;
}
const Type_Decl *td = *mp_vector_at(a->tmpls, Type_Decl*, i);
fseek(f, 0, SEEK_SET);
- const m_str type = tdpp(a->mp, a->st, td, true);
+ const m_str type = tdpp(a->mp, a->st, td, true, true);
sprintf(c, "%s=%s", s_name(spread->tag.sym), type);
pparg_add(a->ppa, c);
free_mstr(a->mp, type);