Calculate return type of lu!(A)

For a given A::M where M <: AbstractMatrix, I would like to calculate typeof(lu!(A)) in the least brittle way. That is,

  1. without exposing internals if possible,

  2. without performing the calculation if possible,

  3. working well at least for usual suspects (eg M = Matrix{Float64}), but ideally for all type stable calls.

  4. returning Any for calls that are not type stable.

(To avoid XY problems: the objective is to build a dictionary, hence I need value types)

typeof(lu!(oneunit(similar(A,1,1)))), maybe?