Writing a method that takes a type with a unit of measure causes the compiler to hang forever with no error, but only if the measure is derived from another measure.
[<Measure>] type Measure1
[<Measure>] type Measure2 = Measure1
type Class() =
member _.Method(x: float<Measure2>) = x
The bug is also present for static methods.
Fable version: 3.0.1 on https://fable.io/repl/#
This rings a bell: #1975
@theprash Would you try to use metre instead of m, please? It's in the Microsoft.FSharp.Data.UnitSystems.SI.UnitNames namespace.
@inosik Yes, this only happens when the unit of measure is derived from another one. I'll update the title and the repro code.
Thanks a lot for reporting @theprash and for the pointer @inosik! There was a version of nonAbbreviatedType in OverloadSuffix that still could fall in the infinite loop. It only affects class members so we didn't see it before. I should put the helper in a common module somewhere to avoid these issues, but for now I just copied the code. It will be fixed in the next release 馃憤
Most helpful comment
Thanks a lot for reporting @theprash and for the pointer @inosik! There was a version of
nonAbbreviatedTypein OverloadSuffix that still could fall in the infinite loop. It only affects class members so we didn't see it before. I should put the helper in a common module somewhere to avoid these issues, but for now I just copied the code. It will be fixed in the next release 馃憤