You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No error or warning on duplicate CompiledName #4737
typeX=|[<CompiledName "ff">] A
|[<CompiledName "ff">] B
Fable, unlike .NET, honours this attribute on union cases. However, it doesn't verify that the names are unique. At the very least I would like to see a warning if there are valid use cases for this, otherwise an error.
You can disable a warning, but you can't conjure one out of thin air:). I am starting to make heavy use of CompiledName and I want compile-time assurance that I didn't make a mistake in duplicating labels.
You can disable a warning, but you can't conjure one out of thin air
Fable does not have this feature (yet)
Also, I confused CompiledName with CompiledValue which is something else.
And indeed, I think have 2 enum cases name being the same is probably strange and should be reported as error. If there are issues with that in the future, we can reduce it to a warning.
typeProp=| Key ofstring| Ref of(Element->unit)/// To be used in combination with `useRef` hook|[<System.Obsolete("Use RefValue")>][<CompiledName("ref")>] RefHook ofIRefHook<Elementoption>|[<CompiledName("ref")>] RefValue ofIRefValue<Elementoption>interface IHTMLProp
I'm also utilising this as a feature for #5075 , but the error could be ignored if there are other attributes attached to one of the duplicate cases? That would protect Fable.React.Props and my use case too.
Activity
MangelMaxime commentedon Jul 8, 2026
I am almost certain that I saw some JavaScript libraries that used different value of enum to map to the same value.
In those scenarios it is normal case and does not need a warning or error message as they would be false positive.
Because of that I am unsure if this is something we can improve.
kerams commentedon Jul 8, 2026
You can disable a warning, but you can't conjure one out of thin air:). I am starting to make heavy use of
CompiledNameand I want compile-time assurance that I didn't make a mistake in duplicating labels.MangelMaxime commentedon Jul 8, 2026
Fable does not have this feature (yet)
Also, I confused
CompiledNamewithCompiledValuewhich is something else.And indeed, I think have 2 enum cases name being the same is probably strange and should be reported as error. If there are issues with that in the future, we can reduce it to a warning.
MangelMaxime commentedon Jul 16, 2026
While working on the fix for this issue I found one Fable library using this feature:
Fable.React.Props.fs
I am still doing more investigation
shayanhabibi commentedon Oct 15, 2026
I'm also utilising this as a feature for #5075 , but the error could be ignored if there are other attributes attached to one of the duplicate cases? That would protect Fable.React.Props and my use case too.
MangelMaxime commentedon Oct 22, 2026
This has been released in 5.24.0