Skip to content
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

Naive fix for #13171 #17075

Merged
merged 3 commits into from
Jul 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/datafmt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion test/linalg/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion test/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
2 changes: 1 addition & 1 deletion test/strings/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down