[Chapel Merge] Extend documentation of using the deprecated keywo

Branch: refs/heads/main
Revision: 4dcc745
Author: lydia-duncan
Link: Extend documentation of using the deprecated keyword, and lock in examples with tests by lydia-duncan · Pull Request #19520 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #19520 from lydia-duncan/depKeywordUses

Extend documentation of using the deprecated keyword, and lock in examples with tests
[reviewed by @slnguyen]

This PR adds some examples for unclear cases to the deprecated keyword
documentation. Specifically, it covers:

  • changing only a function's return type
  • changing only a function's argument name
  • deprecating a field

These cases involve a little extra work to maintain the user's experience,
and it would be easy to deprecate them in a way that did not.

Adds tests to the test system that demonstrate these examples:

  • deprecating a return type
  • deprecating various fields (replaces old "handleField.chpl" test file)
  • deprecating a field and adding an explicit initializer so that Foo(fieldName=val)
    also gives a warning (which also demonstrates the use of "last resort" for changing
    argument names

Checked the built docs and the tests individually. The directory they are in passed
a fresh checkout

Modified Files:
A test/deprecated-keyword/depReturnTypeOnly.chpl

A test/deprecated-keyword/depReturnTypeOnly.compopts
A test/deprecated-keyword/depReturnTypeOnly.off.good
A test/deprecated-keyword/depReturnTypeOnly.on.good
A test/deprecated-keyword/handleField-explicitInits.chpl
A test/deprecated-keyword/handleField-explicitInits.good
M doc/rst/developer/bestPractices/Deprecation.rst
M test/deprecated-keyword/handleField.chpl
M test/deprecated-keyword/handleField.good

Compare: https://github.com/chapel-lang/chapel/compare/0432111a061f...4dcc7456f371