Issue Details (XML | Word | Printable)

Key: BOO-1102
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Avishay Lavie
Reporter: Avishay Lavie
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Type inference for closures

Created: 20/Nov/08 03:24 PM   Updated: 17/Jan/09 11:00 AM   Resolved: 17/Jan/09 09:21 AM
Return to search
Component/s: Compiler
Affects Version/s: None
Fix Version/s: 0.9

Time Tracking:
Issue & Sub-Tasks
Issue Only
Not Specified

Issue Links:
dependent
 

Testcase included: yes

  • Sub-Tasks:
  • All
  • Open

 Description  « Hide

Boo should pick up a closure's missing parameter types from its context.

Declaration context:

closure as callable(int) as bool  = { i | i > 3 }

Assignment context:

closure as callable(int) as bool
closure = { i | i > 3}

Event subscribe context:

event MyEvent as callable(int) as void
MyEvent += { i | print i }

Cast context:

closure = { i | i > 3 } as Predicate[of int]

Method invocation context:

list = List[of int]()
list.FindAll({ i | i > 3})

This functionality should be combined together with overload resolution and type inference for generic method invocations. This will make Boo's type inference capabilities on par with C# 3.0.



Avishay Lavie added a comment - 17/Jan/09 09:21 AM

Landed in revision 3117.


Rodrigo B. de Oliveira added a comment - 17/Jan/09 11:00 AM

WAHOO!!!!