Steve Fenton
Steve Fenton
Here's a related example where backticks cause an issue. In the example, the code block is followed by "which". The suggestion is to add a comma before "which", but the...
We could look at an implementation that largely left the syntax untouched: perhaps we could add a single new keyword that switches on "nominality" for a given interface. That would...
You could also use it to make a type nominal in a specific context, even if the type was not marked as nominal: ``` function getById(id: named CustomerId) { //......
When used as part of a type annotation, it would tell the compiler to compare types nominally, rather than structurally - so you could decide when it is important for...
This is why I'm not a language designer :) I've shown in the example below that the keyword applies for the scope of the variable. If you make a parameter...
I admit that the notion of marking an item as nominal temporarily as per these recent examples may have been a little flippant - in the process of thinking through...
So the most common use case for this (that I can think of) is type-safe ids. Currently, you _can_ create these in TypeScript by adding a private member to a...