Closed kerams closed 4 years ago
I can't reproduce the error. Can you provide more details?
But yes you're right, the line you're removing shouldn't be necessary.
My bad. Have a look at this (turns out aliases aren't the problem). With the extra line this does not compile:
[<Measure>]
type columnDefinitionId
[<Measure>]
type order
type ColumnDefinition = {
Id: int<columnDefinitionId>
Order: int16<order> }
open FSharp.UMX
// This expression was expected to have type 'int16<order>' but here has type 'int16<'u>'
let x = { Id = %1; Order = %2s }
This does:
[<Measure>]
type columnDefinitionId
[<Measure>]
type order
open FSharp.UMX
type ColumnDefinition = {
Id: int<columnDefinitionId>
Order: int16<order> }
let x = { Id = %1; Order = %2s }
When [<MeasureAnnotatedAbbreviation>] type int16<[<Measure>] 'm> = int16
is removed, both snippets are fine.
This line appears to cause problems that I don't quite understand when tagging an
int16
with%
and the expected type is an alias ofint16
with a measure. Perhaps it's because short supports units of measure natively?