mirah/mirah — pull request #182 by shepheb (2012-04-20 18:37:49+00:00)
Title: Support for using generics

These commits add support for the *use* of generics. There is no support (yet) for defining generic classes in Mirah. There are the following caveats:

- Nesting of return types is only allowed to one level. So if I have an `ArrayList` and there's some method that returns `>`, it will not be properly matched. I have not found any such method to test on. Return types like `E` and `Iterator` will match properly.
- Only single `extends` and `implements` bounds are supported. Constraints like `` will fail with an error message explaining this limitation. This limitation should not impede the important use case of the Collections library, and hopefully not much else either.
- The value of a type variable will be the most specific common parent of the types it is matched to in method parameters (not return types). If I have an `ArrayList` and `add("a string")` and `add(Integer.new(7))`, it will infer as an `ArrayList