我使用朱莉婭0.6多類型聲明,用我的代碼在0.5.2就好了,現在我端口運行它,我得到這個錯誤語法:爲「寬度」
syntax: multiple type declarations for "width"
現在,當我grep -rn "width" *
對整個包我得到這樣的結果
coolFile.jl:11: local const width::Int64 = Int64(sqrt(modulation))
coolFile.jl:12: local const mapSize::Tuple{Int64, Int64} = (width, width)
coolFile.jl:19: local const minValue::Float64 = minimumDistance/2 - minimumDistance * width/2
coolFile.jl:20: for y in 1:width
coolFile.jl:22: for x in 1:width
coolFile.jl:44: for i in 1:2:width
coolFile.jl:45: local const startIndex = 1 + width*i
coolFile.jl:46: inplaceReverse(startIndex:(startIndex + width - 1))
我看到的只有一個聲明和寬度的定義。所有這些代碼都在構造函數中。第11行是構造函數體的第一行。我只是瞎了,在某處寫了width::Bananas = -69105
?
您是否嘗試在同一會話中多次導入coolFile.jl(或其中的函數)? –
不需要'width'後的':: Int64',類型由'Int64(sqrt(modulation))'決定。該錯誤消息有點不清楚。 –
@AlexanderMorley否,它應該沒有關係,因爲它是一個局部變量作用於構造函數。 – Nozdrum