[m-rev.] for review: check module qualification when testing for type_info

Zoltan Somogyi zs at cs.mu.OZ.AU
Thu Aug 23 19:25:50 AEST 2001


On 23-Aug-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> I'm not sure what "not compilable" means?  Does it mean the compiler
> falls over because it assumes that any type with the name "type_info" is
> private_builtin__type_info?

I expect so. The compiler does have special handling of type constructors
named "type_info", because unlike other type constructors, they (and the tuple
type constructor) take a variable number of arguments.

> If so isn't this just a plain old bug --
> the user is allowed to have a type called type_info.

I agree, but this change should fix that bug. User-defined type names should
have been module-qualified by the time the code in question is executed,
and the module name "private_builtin" *is* reserved.

We could insist on the type constructor always being module-qualified with the
module private_builtin, but that may require changing polymorphism and any
other part of the compiler that introduces typeinfos.

I think the change is fine, except the comment should explain this
compiler-phase dependence on the procedure that was fixed.

We should also think about whether that procedure should insist on the tuple
type having a particular qualification.

Zoltan.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list