SwensenSoftware / unquote

Write F# unit test assertions as quoted expressions, get step-by-step failure messages for free
http://www.swensensoftware.com/unquote
Apache License 2.0
285 stars 26 forks source link

Change how array type signatures are sprinted to match change in F# language #159

Open stephen-swensen opened 2 years ago

stephen-swensen commented 2 years ago

Per https://github.com/fsharp/fslang-suggestions/issues/635 instead of e.g. int[] we should sprint int array where applicable.

The implementation is found in the ExtraReflections.fs file, given by the sprintSig function. Among other uses, this is used by the Type.FSharpName extension method.

dulanov commented 2 years ago

@stephen-swensen May be similar case with list<_> and option<_>, should be _ list and _ option?

> typeof<float list>.FSharpName;;
val it : string = "list<float>"

> typeof<float option>.FSharpName;;
val it : string = "option<float>"

https://github.com/SwensenSoftware/unquote/blob/master/test/UnquoteTests/FSharpNameTests.fs#L12

dulanov commented 2 years ago

@stephen-swensen jagged & multidimentional arrays, should also be changed to float array array ...?

> typeof<float array array>.FSharpName;;
val it : string = "float[][]"

> typeof<float[,,]>.FSharpName;;
val it : string = "float[,,]"