Closed martinjoshua closed 1 year ago
It look like type names list https://github.com/fsprojects/FSharp.TypeProviders.SDK/blob/master/src/ProvidedTypes.fs#L1247-L1260
out of sync with types from Microsoft.FSharp.Data.UnitSystems.SI
namespace
https://github.com/fsharp/fsharp/blob/master/src/fsharp/FSharp.Core/SI.fs
@martinjoshua Do you want to contribute back the fix? It should as easy as:
ProvidedTypes.fs
ProvidedTypes.fs
and ensure that new names and abbreviation works@sergey-tihon although I'd be happy to help, I really don't think that is the issue here. The units "meter" and "m" are clearly both defined in the list, yet they still result in the above error. I wonder if this has something to do with it being generated types and not erased.
@sergey-tihon although I'd be happy to help, I really don't think that is the issue here. The units "meter" and "m" are clearly both defined in the list, yet they still result in the above error. I wonder if this has something to do with it being generated types and not erased.
These are abbreviations, which do not work. You must use the canonical non-abbreviated name from FSharp.Data.UnitSystems.SI.UnitNames
Looks like this can be closed.
Description
When annotating properties/fields with the
ProvidedMeasureBuilder.SI
method, unit symbols cause an error:[type provider] reported an error: not an array, pointer, or byref type.
This seems to occur because the unit symbol types actually point to the unit name type. For example, the following is defined in SI.fs:
The following will work fine:
However, either of these will result in the above error: