Skip to content

^(::Matrix{Float64},::Float64) not type stable #460

@afniedermayer

Description

@afniedermayer

@code_warntype [1. 1.;1. 0.]^2. shows return type Any, same holds for Complex types, i.e. the test

@testset "type stability of ^(::Matrix{Float64},::Float64)" for elty in (Float64, Float32)
    @test Base.return_types(^, (Matrix{elty}, elty)) == [Matrix{elty}]
    @test Base.return_types(^, (Matrix{Complex{elty}}, elty)) == [Matrix{elty}]
end

fails (both on Julia 0.6 and 0.7). This issue is related to but different from JuliaLang/julia#23366 (Float64 vs Int64).

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs testsUnit tests are required for this change

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions