20511, "jhh67", "misleading error message when initializing an array with the wrong type", "2022-08-25T16:44:56Z"
Summary of Problem
Compiling the code below results in the following error message:
assign.chpl:5: In initializer:
assign.chpl:6: error: cannot iterate over values of type int(64)
The error is that the array elements are a different type from the initial value, not that the initial value cannot be iterated over.
### Steps to Reproduce
**Source Code:**
```chapel
class Dummy {}
class Foo {
var x: [0..1] unmanaged Dummy;
proc init() {
this.x = 42;
}
}
var foo = new Foo();
Compile command:
chpl assign.chpl
Execution command:
./assign.chpl
Associated Future Test(s):
Configuration Information
Output of chpl --version:
chpl version 1.28.0 pre-release (b131550ff3)
Copyright 2020-2022 Hewlett Packard Enterprise Development LP
Copyright 2004-2019 Cray Inc.
(See LICENSE file for more details)
Output of $CHPL_HOME/util/printchplenv --anonymize: