7 Sep 07:55
[jira] Created: (BOO-1340) Invoking a closure on a method inside a generic type causes Bad IL and BadImageFormatException
Invoking a closure on a method inside a generic type causes Bad IL and BadImageFormatException
----------------------------------------------------------------------------------------------
Key: BOO-1340
URL: https://jira.codehaus.org/browse/BOO-1340
Project: Boo
Issue Type: Bug
Components: Compiler
Affects Versions: 0.9.4
Environment: .net 3.5 and 4.0
Reporter: Giovanni Bassi
Priority: Minor
Attempting to call a regular method which references a generic parameter from it's type fails if you try to
pass a closure referencing the generic type.
{code:title=fails.boo|borderStyle=solid}
class Entity:
public Prop as string
class Repository[of T(Entity)]:
def Get(p):
Where({ p | p.Prop == p})
def Where(predicate as System.Func[of T, bool]):
pass
{code}
If you use a closure on an object where the generic parameter is already defined, it doesn't fail. This will pass:
{code:title=works.boo|borderStyle=solid}
(Continue reading)
RSS Feed