# Inv(transpose(mat) ) causes warntype

**URL:** <https://discourse.julialang.org/t/inv-transpose-mat-causes-warntype/16216>\
**Category:** Performance\
**Created:** [October 12, 2018, 6:54am UTC](https://discourse.julialang.org/t/inv-transpose-mat-causes-warntype/16216 "2018-10-12T06:54:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Post date:** [October 12, 2018, 6:54am UTC](https://discourse.julialang.org/t/inv-transpose-mat-causes-warntype/16216/1 "2018-10-12T06:54:04Z")

</div>

hello, I found the following problem in both 1.0.0 and 1.0.1

```julia
mat = reshape(collect(1.0:4.0), 2, 2)

julia> @code_warntype inv(transpose(mat) ) # gives warntype
Body::Any

@code_warntype inv(copy(transpose(mat) ) ) # fine

```

---

<div class="post-metadata">

**Author:** ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Post date:** [October 12, 2018, 2:06pm UTC](https://discourse.julialang.org/t/inv-transpose-mat-causes-warntype/16216/2 "2018-10-12T14:06:54Z")

</div>

besides, for 1x1 matrix, (in version 1.0.1) the following not only gives a warning but an **error** :

```julia
julia> mat1 = reshape([3.0], 1, 1)
1×1 Array{Float64,2}:
 3.0

julia> inv(transpose(mat1) )
ERROR: MethodError: no method matching ldiv!(::Float64, ::Array{Float64,2})

```
