ceylon / ceylon-spec

DEPRECATED
Apache License 2.0
108 stars 34 forks source link

Move handling of backend scoping from visitors to `Scope` #1392

Closed quintesse closed 9 years ago

quintesse commented 9 years ago

This issue was originally called "Native doesn't deal correctly with SpecifierExpressions", with the following description:

See ceylon/ceylon-js#609 for example.

It's because SpecifierExpressions are dealt with before the declaration they belong to, so the system in place to determine the "scope" of a native annotation fails to work.

Discussed with @gavinking to make the backend detection part of the Scope so one can do decl.getScope().getBackend() or something similar.

But in the end it was only used to implement the changes to the backend scoping suggested by Gavin so I changed the title to express the work that was done.

Before this change the detection of backend "scopes" was done by each visitor. They also got passed a backendSupport at construction so we could check what backends were actually supported (a jvm compiler doesn't care about native code for JS).

Now the scopes are handled in Scope itself and the backend support can be retrieved from Unit.

gavinking commented 9 years ago

Not sure if I care much.