[Chapel Merge] dyno: fix resolving declarations with both type an

Branch: refs/heads/main
Revision: 88a7ffe
Author: DanilaFe
Link: dyno: fix resolving declarations with both type and initializer by DanilaFe · Pull Request #20149 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #20149 from DanilaFe/fix-resolve-type-and-init

dyno: fix resolving declarations with both type and initializer

Prior to this PR, the resolver directly compared the type of a
declaration's type expression to the type of its initializer. This
doesn't work, since the initial expression is a value, and not a
type, while the type expression is. Thus, getTypeForDecl
should appropriately adjust the declared type's kind to match
the declaration's kind before comparing it against the type of
the initializer expression.

Reviewed by @benharsh, thanks!

Modified Files:
A compiler/dyno/test/resolution/testTypeAndInit.cpp

M compiler/dyno/lib/resolution/Resolver.cpp
M compiler/dyno/test/resolution/CMakeLists.txt

Compare: https://github.com/chapel-lang/chapel/compare/a9ff0f1028e9...88a7ffeee27b