Hi, I've run into a strange error while using I felt was a natural use of nested records. Below is a snippet. It tries to use the parameterized types to create an nested record which is then entries in a hash. There's a few errors when I compile and eventually the only way to get it to work was to pull ValueType and TableEntry up into the top-level of the module. Any ideas? I didn't see much on this in the spec.
Thanks!
Brian
/*
test/nested_class.chpl:22: error: unresolved type specifier
'LockFreeHash(uint(32)).TableEntry'
test/nested_class.chpl:13: note: candidates are: TableEntry(_mt: _MT, outer)
*/
module LockFreeHash {
type KeyType = uint(32);
class LockFreeHash {
type ValueType = uint(32);
var hashSize: uint(32) = 1024*1024;
record TableEntry {
var key: atomic KeyType;
var value: atomic ValueType;
// test/nested_class.chpl:18: error: constructor for class
'TableEntry' requires a generic argument called 'outer'
proc TableEntry(outer: LockFreeHash) {
key.write(0);
}
}
var array: [0..hashSize-1] TableEntry;
// removed methods
}
}
nested_class.chpl
Description: Binary data
------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________ Chapel-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/chapel-developers
