Brad Chamberlain wrote:
>
>> 1. Operators get confused with the type of enum constants
>> and can't figure out they're ints. Explicit casting working.
>> For example, using the enum on p. 41 of the spec,
>> writef(:enum val 0x%06xu\n", foo.red)
>> works,
>> writef("red plane 0x%06xu\n", pixel & foo.red);
>> does not, but
>> writef("red plane 0x%06xu\n", pixel & (foo.red : uint));
>> does.
>
> I'm trying to reproduce this problem and not having much luck. What is
> the type of pixel? Could you send a code snippet demonstrating the issue?
>
>
This fails to compile:
enum clrmasks { RED = 0xff0000, GREEN=0x00ff00, BLUE=0x0000ff }
var g = 0x123456 & clrmasks.GREEN;
with a modules/internal/ChapelBase.chpl:532 error: Initializng
parameter 'ret' to value not known at compile time
So does
writef("g = 0x%06xu\n", 0x123456 & clrmasks.GREEN);
But this works
const pix = 0x123456;
writef("g = 0x%06xu\n", pix & clrmasks.GREEN);
I would swear we had code involving the bit operators or assignment
that failed because the compiler couldn't resolve the types of the
arguments that worked a variable, but since it never compiled, the code
never got checked in and saved; it'll be hard to duplicate the exact
problem, but I'll see if I can find an old version.
>> 2. Will it be possible to use a multi-dimensional array as an
>> argument? It generates a compiler error
>> > unresolved call 'chpl__buildArrayRuntimeType(nil, type int(64))'
>> > note: candidates are: chpl__buildArrayRuntimeType(dom : domain,
>> type eltType)
>
> Could you send a code snippet for this one too? It is possible to pass
> multidimensional arrays around as arguments. The issue may relate more
> to the formal argument type than the actual argument passed...
>
> -Brad
>
It's the same problem here. This was in an early attempt in a program
that didn't compile, so the data structures were changed (pushing the
one array into a class and passing an array of instances). It never
got saved. I'll see if it can be regenerated.
Greg
------------------------------------------------------------------------------
_______________________________________________
Chapel-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-bugs