Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Singleton value for argumentless union cases #696
Currently WS creates a new object on each union case construction, whereas in .NET argumentless union cases use a single static instance. This should follow .NET semantics closer for performance.
type Evnt = | START | DONE let x = Evnt.START let y = Evnt.START obj.ReferenceEquals(x,y) // f# = true, w# = false
A regression: unions with no prototype and a singleton case will have an Address on their metadata, to look up singleton values. Type checks against the union (for example using it in an erased union) will mistakenly think the address is also a valid prototype to check against, ignoring HasWsPrototype