Me again :)

I've spotted something else that I *think* is a bug in how resolve
works. A double array will resolve as a double. I haven't checked this
against object arrays or other primitive arrays. The following awesome
F# code demonstrates this (apologies for any line wrapping):

open Mono.Cecil

[<EntryPoint>]
let main args =
   match List.ofArray args with
   | inAssemFile :: _ ->
       let assem = AssemblyDefinition.ReadAssembly inAssemFile
       let dblArr = new ArrayType(assem.MainModule.TypeSystem.Double)
       let resDblArr = dblArr.Resolve()
       printfn "double arr=%A, resolved=%A" dblArr resDblArr
       printfn "double arr metatype=%A, resolved metatype=%A"
dblArr.MetadataType resDblArr.MetadataType

   | _ -> failwithf "bad options %A" args

   // exit success
   0

This will result in the following being printed:

double arr=System.Double[], resolved=System.Double
double arr metatype=Array, resolved metatype=Double

Thanks, Keith

-- 
keithsheppard.name

-- 
--
mono-cecil

Reply via email to