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

metamodel for late attributes #671

Open
tombentley opened this issue May 6, 2015 · 3 comments
Open

metamodel for late attributes #671

tombentley opened this issue May 6, 2015 · 3 comments
Milestone

Comments

@tombentley
Copy link
Member

class Example() {
    shared late Integer i;
}
print(type(`Example.i`));

prints com.redhat.ceylon.compiler.java.runtime.metamodel::AppliedAttribute<example::Example,ceylon.language::Integer,Nothing>, so the Setter type parameter of Attribute is Nothing. This means I cannot call set() on the bound Value<Integer,Nothing> I obtain from that Attriibute.

If I try to use setIfAssignable() I get an exception "Value is not mutable".

This makes late attributes pretty much unusable from the metamodel.

@tombentley tombentley added this to the 1.2 milestone May 6, 2015
@jvasileff
Copy link
Member

Some way of assigning to non-variable late attributes will be necessary in order to implement dependency injection in Ceylon. Constructor injection isn't always an option.

@jvasileff
Copy link
Member

And I suppose without ceylon/ceylon-compiler#2153, attribute-injection would be my preferred form of injection :).

@FroMage
Copy link
Member

FroMage commented Jun 16, 2015

Moving to 1.3.

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

No branches or pull requests

3 participants