[m-rev.] for review: check module qualification when testing for type_info
Tyson Dowd
trd at cs.mu.OZ.AU
Thu Aug 23 19:39:52 AEST 2001
On 23-Aug-2001, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> 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.
For the record, the higher order type constructor is treated specially
too.
>
> > 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.
Sorry, I didn't meant to indicate any doubt about that, I think this is
the right change, I just wasn't sure from the comment and the log
message what the intention was.
> 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.
This is a good idea.
> We should also think about whether that procedure should insist on the tuple
> type having a particular qualification.
I think this is probably the right approach.
Tyson.
--------------------------------------------------------------------------
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