[m-dev.] diff: unbound type variables.

Fergus Henderson fjh at cs.mu.oz.au
Wed Apr 30 11:56:41 AEST 1997


Tyson Richard DOWD, you wrote:
> 
> Fix the (long-time) temporary hack to generate NULL pointers as
> type_infos for unbound type variables.

> +		% Passing `void'/0 should ensure that we get a runtime
> +		% error if the special predicates for this type are
> +		% every used (void has its special predicates set to
> +		% `unused'/0).

s/every/ever/

> +		TypeId = unqualified("void") - 0,
> +		polymorphism__construct_type_info(Type, TypeId, [],
> +			no, ModuleInfo, TypeInfoMap, VarSet0, VarTypes0,
> +			Var, ExtraGoals, VarSet, VarTypes)
>  	).

Hmmm... should it be unqualified("void")
or qualified("mercury_builtin", "void")?

> +	if ((Word) arg_pseudo_type_info < TYPELAYOUT_MAX_VARINT) {
>  		fatal_error(""unbound type variable"");
>  	}

Please use the macro you recently added for this,
MR_<something-or-other>_IS_VARIABLE().

> +			if (type_info[i] < TYPELAYOUT_MAX_VARINT) {

Ditto.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list