diff --git a/base/operators.jl b/base/operators.jl index 6570a14e3e612..6f1849f60d911 100644 --- a/base/operators.jl +++ b/base/operators.jl @@ -293,7 +293,7 @@ fldmod1{T<:Real}(x::T, y::T) = (fld1(x,y), mod1(x,y)) fldmod1{T<:Integer}(x::T, y::T) = (fld1(x,y), mod1(x,y)) # transpose -transpose(x) = x +transpose(x) = throw(ArgumentError("transpose not implemented for $(typeof(x)). Consider permutedims.")) ctranspose(x) = conj(transpose(x)) conj(x) = x diff --git a/test/datafmt.jl b/test/datafmt.jl index 7116a2af614dc..4b97da3a32ef3 100644 --- a/test/datafmt.jl +++ b/test/datafmt.jl @@ -210,7 +210,7 @@ let i18n_data = ["Origin (English)", "Name (English)", "Origin (Native)", "Name "Yugoslavia (Cyrillic)", "Djordje Balasevic", "Југославија", "Ђорђе Балашевић", "Yugoslavia (Latin)", "Djordje Balasevic", "Jugoslavija", "Đorđe Balašević"] - i18n_arr = transpose(reshape(i18n_data, 4, Int(floor(length(i18n_data)/4)))) + i18n_arr = permutedims(reshape(i18n_data, 4, Int(floor(length(i18n_data)/4))), [2, 1]) i18n_buff = PipeBuffer() writedlm(i18n_buff, i18n_arr, ',') @test i18n_arr == readcsv(i18n_buff) diff --git a/test/linalg/matmul.jl b/test/linalg/matmul.jl index 0f44b8cf8479c..f3fbb5f3d92a7 100644 --- a/test/linalg/matmul.jl +++ b/test/linalg/matmul.jl @@ -320,8 +320,9 @@ end immutable RootInt i::Int end -import Base: *, promote_op +import Base: *, transpose, promote_op (*)(x::RootInt, y::RootInt) = x.i*y.i +transpose(x::RootInt) = x promote_op(::typeof(*), ::Type{RootInt}, ::Type{RootInt}) = Int a = [RootInt(3)] diff --git a/test/operators.jl b/test/operators.jl index 36f80a6033ddf..07031ed2ff81e 100644 --- a/test/operators.jl +++ b/test/operators.jl @@ -33,7 +33,7 @@ p = 1=>:foo @test (|)(2) == 2 @test ($)(2) == 2 -@test ctranspose('a') == 'a' +# @test ctranspose('a') == 'a' # (c)transpose of Chars no longer supported @test_throws ArgumentError Base.scalarmin(['a','b'],['c','d']) @test_throws ArgumentError Base.scalarmin('a',['c','d']) diff --git a/test/strings/basic.jl b/test/strings/basic.jl index f8a63850a0253..183ec1ea74933 100644 --- a/test/strings/basic.jl +++ b/test/strings/basic.jl @@ -464,7 +464,7 @@ foobaz(ch) = reinterpret(Char, typemax(UInt32)) @test "a".*["b","c"] == ["ab","ac"] @test ["b","c"].*"a" == ["ba","ca"] -@test ["a","b"].*["c","d"]' == ["ac" "ad"; "bc" "bd"] +@test ["a","b"].*["c" "d"] == ["ac" "ad"; "bc" "bd"] # Make sure NULL pointers are handled consistently by String @test_throws ArgumentError unsafe_string(Ptr{UInt8}(0))