20259, "ghbrown", "Methods can be defined on variables", "2022-07-19T21:19:49Z"
Summary of Problem
Methods can be defined on variable instances of records, but you should only be able to define them on types.
Steps to Reproduce
Brad's minimal working/failing example given on the Discourse:
record R {
}
var myR: R;
// this is OK, since R is a type
proc R.foo() {
writeln("In foo()");
}
// this shouldn't be OK, myR is a value
proc myR.bar() {
writeln("In bar()");
}
myR.foo();
myR.bar();
Compile command:
chpl
Configuration Information
using packaged version on Arch
chpl version 1.28.0 pre-release (c95e180325)
built with LLVM version 14.0.6