Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

cannot extend Java static member class that implements containing interface in Ceylon #6373

Closed
jvasileff opened this issue Jul 15, 2016 · 4 comments

Comments

@jvasileff
Copy link
Contributor

For extension only, the typechecker incorrectly considers a static class to be a member of its containing class or interface if the static class extends or implements its containing class or interface.

In Java:

package simplejvm;

public interface JavaInterface {
    public static class C implements JavaInterface {} // uncommon
    public static interface I extends JavaInterface {} // similar to Map.Entry
}

in Ceylon:

import simplejvm {
    JavaInterface {
        JavaInterfaceC = C,
        JavaInterfaceI = I
    }
}

class CC() extends JavaInterfaceC() {} // error
class CI() satisfies JavaInterfaceI {} // ok

// Inherited member class may not be extended in initializer of CC:
// C is inherited by CC from JavaInterface

Note that in other regards, the static class C is not considered a member. For example, C can be given a static method which can be invoked directly without problems.

@jvasileff
Copy link
Contributor Author

In the interest of full disclosure, the reason I care about this is jvasileff/ceylon-dart#8 (comment)

@gavinking gavinking added this to the 1.2.3 milestone Jul 16, 2016
@gavinking gavinking self-assigned this Jul 16, 2016
@gavinking
Copy link
Contributor

This is fixed, but I would also like to see if I can change the grammar so that the import alias is no longer necessary.

@gavinking
Copy link
Contributor

Done.

@jvasileff
Copy link
Contributor Author

Awesome. Thanks!

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

No branches or pull requests

2 participants