There is a strange compile error happening on the script scenario below. Somewhat related to [[ https://feedback.bistudio.com/T166843 | Static array initializer unable to distinguish overloads ]], but likely a separate issue.
```
class StrongTypedArray<Class T>
{
static array<T> From(notnull array<T> values)
{
return values;
}
}
class ReproduceItem
{
static ReproduceItem From(array<int> integers)
{
}
static ReproduceItem From(array<float> floats)
{
}
static ReproduceItem From(array<bool> bools)
{
}
}
class ReproduceContainer
{
static ReproduceContainer From(array<ReproduceItem> items)
{
}
}
void ReproduceTheIssue()
{
ReproduceContainer container = ReproduceContainer.From({
ReproduceItem.From(StrongTypedArray<int>.From({1, 2, 3})),
ReproduceItem.From(StrongTypedArray<float>.From({1.1, 2.2, 3.3})),
});
}
```
The code above when trying to compile results in:
> SCRIPT (E): @"Scripts/Game/test.c,33": Unsafe down-casting, use 'array<ReproduceItem>.Cast' for safe down-casting
It is worth mentioning that the error "disappears" after a code change to this - removing the return value. it also only happens when this strong array type wrapper is used. In other scenarios, I did not experience any problems with the static initializer in general.
```
class StrongTypedArray<Class T>
{
static array<T> From(notnull array<T> values)
{
//return values;
}
}
```