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: deal with Java overloading #293

Open
FroMage opened this issue Sep 16, 2013 · 6 comments
Open

Metamodel: deal with Java overloading #293

FroMage opened this issue Sep 16, 2013 · 6 comments

Comments

@FroMage
Copy link
Member

FroMage commented Sep 16, 2013

The APIs are not currently made to support this, we need to figure it out.

@gavinking gavinking mentioned this issue Sep 16, 2013
50 tasks
@FroMage
Copy link
Member Author

FroMage commented Nov 4, 2013

@gavinking any idea how I should implement that? I expect you don't want overloading to leak in the API?

I'm very tempted to move this out to 1.2

@gavinking
Copy link
Member

I'm very tempted to move this out to 1.2

Fine by me.

@FroMage
Copy link
Member Author

FroMage commented Nov 5, 2013

The thing about the metamodel is that people will expect that we can do type(foo) on anything even if foo is a Java instance. So naturally Java idioms tend to leak.

Given Java's overloading we can't even detect overloading without lots of work, for example:

class Top {
 public void foo(){}
}
class Bottom extends Top {
 public void foo(int i){}
}

There is overloading, and yet none of these methods will be marked as being overloaded or an abstraction. The questions are:

  • Do we need to support overloading in any way (invoke one or both foo given a Bottom instance)
  • If yes how, and when (I strongly suppose it can wait for post-1.0)
  • If not yet, do we need to do anything about overloading ATM, like skip abstractions (abstractions do not have a valid return type, at least for methods) or how the metamodel should react given overloading?

@gavinking
Copy link
Member

  • Do we need to support overloading in any way (invoke one or both foo given a Bottom instance)

There are no instances of Nothing. So that's impossible,

  • If yes how, and when (I strongly suppose it can wait for post-1.0)

It can wait.

  • If not yet, do we need to do anything about overloading ATM, like skip abstractions (abstractions do not have a valid return type, at least for methods)

Sure, either:

  1. skip 'em,
  2. return a Method<Foo,Anything,Nothing>, or
  3. throw an exception.

I guess option 2 is preferable.

@FroMage
Copy link
Member Author

FroMage commented Nov 5, 2013

Sorry no time for 1.0

@FroMage FroMage modified the milestones: 1.2, 1.1 Apr 3, 2014
@FroMage
Copy link
Member Author

FroMage commented Apr 3, 2014

Moving to 1.2

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

2 participants