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

Methods returning Collections cannot be used in for-each loops #102

Closed
echebbi opened this issue Feb 25, 2020 · 0 comments · Fixed by #104
Closed

Methods returning Collections cannot be used in for-each loops #102

echebbi opened this issue Feb 25, 2020 · 0 comments · Fixed by #104
Assignees
Labels

Comments

@echebbi
Copy link
Collaborator

echebbi commented Feb 25, 2020

Expected behavior

We can call a method that returns a Collection to initiate the range of a for-each loop:

open class HelloWorld {	

    @main
    override void greeting() {
        for (name in self.names()) {
            name.log();
        }
    }
	
    def Sequence(String) names() {
        result := Sequence{'Lorem', 'Ipsum'};
    }	

}

Current behavior

The editor shows an error Expected Collection but was [ecore::EEList].

The interpreter behaves as expected so this only affects the type checker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant