[m-rev.] for review: merge foreign_type pragma on to the main branch

Peter Ross peter.ross at miscrit.be
Wed Oct 31 22:57:20 AEDT 2001


Fergus wrote:
> On 24-Oct-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > +++ compiler/ilasm.m
> > @@ -701,8 +701,57 @@
> >  output_simple_type(string, I, I) --> io__write_string("string").
> >  output_simple_type(refany, I, I) --> io__write_string("refany").
> >  output_simple_type(class(Name), Info0, Info) -->
> > - io__write_string("class "),
> > - output_structured_name(Name, Info0, Info).
> > + { Name = structured_name(AssemblyName, QualifiedName, _) },
> > + % Parition II section 'Built-in Types' (7.2 in Beta2) states
> > + % that all builtin types *must* be rereferenced by their
> > + % special encoding.  See Parition I 'Built-In Types'
> > + % (8.2.2 in Beta2) for the list of all builtin types.
> > + (
> > + { AssemblyName = assembly("mscorlib") },
> > + { QualifiedName = ["System", TypeName] }
> > + ->
> > + ( { TypeName = "Boolean" } ->
> > + output_simple_type(bool, Info0, Info)
> ...
> >  output_simple_type(value_class(Name), Info0, Info) -->
> >  io__write_string("valuetype "),
> >  output_structured_name(Name, Info0, Info).
>
> `bool' is equivalent to `value class [mscorlib]System.Boolean',
> not to `class [mscorlib]System.Boolean'.
>
> So shouldn't the tests for "Boolean" and other builtin
> value types be in the `value_class/1' clause,
> rather than the `class/1' clause?
>
You are correct, however I think you have found a bug in our code.  I think
there are times when we generate code which constructs 'class
[mscorlib]System.Bool'.  I will change to code so that it throws an error
when trying to output a class which should be a value class.

Pete

--------------------------------------------------------------------------
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