Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to define a LINQ extension method #110

Closed
masonwheeler opened this issue Apr 11, 2015 · 0 comments
Closed

Unable to define a LINQ extension method #110

masonwheeler opened this issue Apr 11, 2015 · 0 comments

Comments

@masonwheeler
Copy link
Contributor

namespace MyNamespace

import System
import System.Collections.Generic
import Boo.Lang.Compiler

[Extension]
def IndexWhere[of T]([Required] coll as IEnumerable[of T], [Required] filter as Func[of T, bool]) as IEnumerable[of int]:
    return IndexWhereImpl(coll, filter)

private def IndexWhereImpl[of T](coll as IEnumerable[of T], filter as Func[of T, bool]) as IEnumerable[of int]:
    index = 0
    for value in coll:
        if filter(value):
            yield index
        ++index

Expected: This should work
Observed: Internal compiler error: Failed to create 'MyNamespace.MyNamespaceModule.$IndexWhereImpl$248.$' type.. (BCE0055)

masonwheeler added a commit that referenced this issue Jan 3, 2017
Massive upgrade to the generator-building code to handle generators from
generic methods.
(Ie. "def MyMethod[of T]()" which includes yield statements)
masonwheeler added a commit that referenced this issue Jan 21, 2017
Massive upgrade to the generator-building code to handle generators from
generic methods.
(Ie. "def MyMethod[of T]()" which includes yield statements)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant