jonsterling/Foam — Issue #23: Legacy YES/NO identifiers not factored into type inference
Author: jonsterling
Created: 2012-01-11 21:36:54+00:00
State: open

Unboxed `BOOL` values can be expressed using `%yes` and `%no`, but the Objective-C constants `YES` and `NO` still work of course. They are just treated like any other identifier. Since they'll likely be used frequently instead of the sigil'd versions, we need to make sure that their types are inferred correctly, so that the following works:

~~~~ruby
- itemShouldAppearAnimated: item [
^ YES.
]
~~~~

As it stands, the return type of this method would be inferred as `id`, which is incorrect. Currently, consumers would have to provide a type hint to the method signature: `- {BOOL}itemShouldAppearAnimated: item`, which is less than ideal.