Julia创建矩阵时报LoadError: MethodError


#1
# code
a = ones(3,3)
b = Array(Int32, 3, 3)
println(a)
println(b)

ERROR: LoadError: MethodError: no method matching Array(::Type{Int32}, ::Int64, ::Int64)
Closest candidates are:
Array(!Matched::LinearAlgebra.UniformScaling, ::Integer, ::Integer) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\LinearAlgebra\src\uniformscaling.jl:345
Stacktrace:
[1] top-level scope at none:0
[2] include at .\boot.jl:326 [inlined]
[3] include_relative(::Module, ::String) at .\loading.jl:1038
[4] include(::Module, ::String) at .\sysimg.jl:29
[5] exec_options(::Base.JLOptions) at .\client.jl:267
[6] _start() at .\client.jl:436
in expression starting at E:\workspaces\loc_workspaces\julia\test.jl:478

实际上根本没有C:\cygwin…这个目录,但是在调用ones(3,3)时没有错误。这个怎么解决?谢谢!
补充:julia版本0.7和1.1.0都报这个错误。


#2

b = Array{Int32, 2}(undef, 3, 3)


#3

非常感谢!确实可行!这个语法越来越像C++的template了:-(。