diff --git a/lang/m2/comp/def.c b/lang/m2/comp/def.c index 516b6fdb..be972ca4 100644 --- a/lang/m2/comp/def.c +++ b/lang/m2/comp/def.c @@ -74,6 +74,7 @@ MkDef(id, scope, kind) df->df_kind = kind; df->df_next = id->id_def; id->id_def = df; + if (kind == D_ERROR) df->df_type = error_type; /* enter the definition in the list of definitions in this scope */ diff --git a/lang/m2/comp/defmodule.c b/lang/m2/comp/defmodule.c index 5df8e443..adb5e81f 100644 --- a/lang/m2/comp/defmodule.c +++ b/lang/m2/comp/defmodule.c @@ -145,7 +145,6 @@ GetDefinitionModule(id, incr) } if (! df) { df = MkDef(id, GlobalScope, D_ERROR); - df->df_type = error_type; df->mod_vis = vis; newsc->sc_definedby = df; } diff --git a/lang/m2/comp/lookup.c b/lang/m2/comp/lookup.c index 1c589ec1..0eb38a46 100644 --- a/lang/m2/comp/lookup.c +++ b/lang/m2/comp/lookup.c @@ -83,6 +83,5 @@ lookfor(id, vis, give_error) if (give_error) id_not_declared(id); df = MkDef(id->nd_IDF, vis->sc_scope, D_ERROR); - df->df_type = error_type; return df; }