jeffrey-s-foster/rtc — Issue #9: Implement runtime annotations
Author: jtoman
Created: 2012-02-24 22:08:38+00:00
State: open

Allow types to be annotated at runtime. This would be done via the rtc_annotate method. This would allow for the types of arrays to be constrained. By defaults, parameterized classes are "dynamic", which means that their type parameters can change over time, depending on what operations are performed on the object. For instance:

```ruby
a = [1] #has type Array
a.push("foo") #now has type Array
a.delete_at(0) #now has type Array
```
However, there are times when a programmer may want to fix the type of an array. This would be done via:

```ruby
a = [1].rtc_annotate("Array")
a.push("foo") #would fail with a type error
```

The method for constraining a type variable is already in place, but the implementation not very robust, and the rtc_annotate function remains unimplemented.