[Chapel Merge] Add tests and futures looking at I/O on class hier

Branch: refs/heads/master
Revision: cc38a3b
Author: bradcray
Log Message:

Merge pull request #16920 from bradcray/class-io-tests

Add tests and futures looking at I/O on class hierarchies

[trivial, includes code developed by @ronawho, @mppf has looked at it at least a bit]

In the performance meeting yesterday, during some discussions about I/O and class hierarchies, we talked about some surprises which led me to write some tests, which led to some additional surprises. The theme of the main tests here is “What kind of compiler-generated writeThis() routines are generated (or not) in a class hierarchy, particularly when some classes have supplied their own writeThis() overloads?” The tests seem to indicate inconsistent behavior in which sometimes a completely distinct compiler-generated routine is called, and in some cases it seems not to be.

The tests are as follows:

  • classIOinHierarchy-default.chpl: what happens when no user overrides are supplied? (works as I’d currently expect)
  • halt-in-parent-class-io.chpl: seems to indicate that the compiler generates a routine for the child class that has no bearing on the parent class; this surprises me, as I’d expect the child to just inherit the parent class method (or, if not, for the compiler-generated routine to call into the parent-class routine)
  • classIOinHierarchy-override.chpl: what happens if we define a writeThis() on the middle class of a 3-class hierarchy? this test’s behavior is really puzzling to me, and seems inconsistent both with itself and the previous tests
  • classToString.chpl: this is mostly unrelated to the above, but is a prototype of a library routine we could supply that generates a string representing a class expression’s type.

Modified Files:
A test/classes/io/classIOinHierarchy-default.chpl
A test/classes/io/classIOinHierarchy-default.good
A test/classes/io/classIOinHierarchy-override.bad
A test/classes/io/classIOinHierarchy-override.chpl
A test/classes/io/classIOinHierarchy-override.future
A test/classes/io/classIOinHierarchy-override.good
A test/classes/io/classToString.chpl
A test/classes/io/classToString.good
A test/classes/io/halt-in-parent-class-io.bad
A test/classes/io/halt-in-parent-class-io.chpl
A test/classes/io/halt-in-parent-class-io.future
A test/classes/io/halt-in-parent-class-io.good

Compare: Comparing b6083d9876dc...cc38a3b154b6 · chapel-lang/chapel · GitHub