Ive got an odd one here. Ive reduced the bug I'm seeing in an assignment to the most minimal components that still give the error (so dont worry about the function of the code).
Compiling the code (which is also attached):
class GenericClass {
type eltType ;
// fixed if field Domain removed
// fixed if added rank=1 to domain type 'constructor'
// side effect: broken (same error) if idxType=uint
var Domain : domain(idxType=int); // Compiler complains here: error:
unable to resolve type
}
// fixed if arguments (and type T query) reversed
// fixed if procedure removed
// fixed if 'object' argument removed
// fixed if change to object : GenericClass(?Z), and added where T==Z clause
// fixed if primitive is not generically typed, and object type has the
type query (?T)
// fixed if procedure is not an operator (e.g. foo( primative ... ) )
// fixed if operator is %
// broken if operator is + * & | (maybe more)
proc +( primative : ?T, object : GenericClass(T) ) : GenericClass(T) {
return new GenericClass( eltType = T );
}
// fixed if made int
var a = new GenericClass( eltType = real );
results in the compile time error:
test.chpl:6: error: unable to resolve type
If any one of the changes from the 'fixed if' comments results in the
program compiling with no errors.
This doesn't seem correct.
Why does eltType affect the domain type?
Why would adding rank=? fix the problem (but only for idxType=int)?
How does the operator overload involve the resolution of the domain type in
GenericClass?
Why does changing the order of arguments fix the error?
Is there a bug in the code itself (am I doing something wrong) or is there
something buggy with the compiler?
Using 1.11.0.
Note: I do not have the option of using the repository compiler
-Ian J. Bertolacci
test.chpl
Description: Binary data
------------------------------------------------------------------------------
_______________________________________________ Chapel-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/chapel-users
