New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't initialize nested StaticArrays at the top level #6536
Comments
It is bug because this code works fine: def foo
StaticArray[StaticArray[1, 2, 3]]
end
p foo Wrapping And bonus, class Foo
macro [](x)
typeof({{x}})
end
end
Foo[Foo[1]] |
Interestingly enough, now I'm getting the same error message trying to manually do what the macro was supposed to do: m : StaticArray(StaticArray(Float64, 3), 3) = begin
a = StaticArray[1.0, 2.0, 3.0]
b = StaticArray[4.0, 5.0, 6.0]
c = StaticArray[7.0, 8.0, 9.0]
StaticArray[a, b, c]
end Error message:
Neither does this work: m : StaticArray(StaticArray(Float64, 3), 3) = begin
res = uninitialized StaticArray(StaticArray(Float64, 3), 3)
res[0] = StaticArray[1.0, 2.0, 3.0]
res[1] = StaticArray[4.0, 5.0, 6.0]
res[2] = StaticArray[7.0, 8.0, 9.0]
res
end
¯_(ツ)_/¯ |
Reduced: macro foo
end
typeof(foo) # Error: macro 'foo' must be defined before this point but is defined later |
This code compiles:
This one returns an error:
The text was updated successfully, but these errors were encountered: