[Chapel Merge] CG: Adjust in-intent handling to fix a memleak

Branch: refs/heads/master
Revision: 4ba5332
Author: vasslitvinov
Log Message:

Merge pull request #17480 from vasslitvinov/fix-CG-memleak

CG: Adjust in-intent handling to fix a memleak

This fixes the memory leaks in
test/constrained-generics/basic/set1/class-and-record.chpl

by treating CG-types like records in more places.

Discussed and developed with @mppf

Modified Files:
M compiler/resolution/resolveFunction.cpp

Compare: https://github.com/chapel-lang/chapel/compare/429234274328...4ba5332b44ba