Open BryantLam opened 5 years ago
Related #8351
Bug. Compiler errors from use of first-class functions/lambdas as arguments to a generic member function of generically parameterized record.
record R { param size: uint; } record S { param size: uint; var r: R(size); } // error: illegal access of first class function proc S.funcA(const functor): string { return functor(r); } // error: unresolved call 'S(10:uint(64)).funcB(chpl__fcf_type_R_10_string)' proc S.funcB(const functor): string where functor.argTypes == 1*R(size) && functor.retType == string { return functor(r); } record T {} record U { var t: T; } // Okay proc U.func(const functor): string where functor.argTypes == 1*T && functor.retType == string { return functor(t); } proc main() { var s: S(10); writeln(s.funcA(lambda(r: R(10)){ return r.type:string; })); writeln(s.funcB(lambda(r: R(10)){ return r.type:string; })); var u: U; writeln(u.func(lambda(t: T){ return t.type:string; })); }
chpl verison 1.19.0 pre-release (543e9e67b1)
This compiles for me now, with output
R(10:uint(64)) R(10:uint(64)) T
Related #8351
Summary of Problem
Bug. Compiler errors from use of first-class functions/lambdas as arguments to a generic member function of generically parameterized record.
Configuration Information
chpl verison 1.19.0 pre-release (543e9e67b1)