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

Fix support for static trait methods #1152

Closed
eric-milles opened this issue Aug 2, 2020 · 2 comments
Closed

Fix support for static trait methods #1152

eric-milles opened this issue Aug 2, 2020 · 2 comments
Assignees
Milestone

Comments

@eric-milles
Copy link
Member

eric-milles commented Aug 2, 2020

Consider the following:

trait T {
  static m() { 'T' }
}
class C implements T {
}
print C.m()
print T.m()

Should print "T" when compiled and executed followed by MissingMethodException. Also, Java sources should behave as follows:

public class J {
  static void main(String[] args) {
    System.out.print(C.m()); // should output "T"
    System.out.print(T.m()); // should not be found
  }
}
@eric-milles
Copy link
Member Author

image

All occurrences of "T.m()" should infer as unknown. Traits do not have default or static methods at run-time; they belong to the implementing class.

@eric-milles
Copy link
Member Author

eric-milles commented Aug 2, 2020

image

eric-milles added a commit that referenced this issue Aug 3, 2020
- copy them (without private modifier) to implementing class(es)
eric-milles added a commit that referenced this issue Aug 4, 2020
- copy them (without private modifier) to implementing class(es)
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

1 participant