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

Static Binding Generator invalid generated class #753

Closed
petekanev opened this issue Apr 27, 2017 · 1 comment
Closed

Static Binding Generator invalid generated class #753

petekanev opened this issue Apr 27, 2017 · 1 comment
Assignees
Labels

Comments

@petekanev
Copy link
Contributor

petekanev commented Apr 27, 2017

Problem:

Consider the following Java classes:

abstract class A {
 public A methodA() { ... }
 public void methodB(A param1) { ... }
}
 package com.example;

 class B extends A { 
  public B methodA() { ... }
  public void methodB(B param1) { ... }
 }

And the code that extends class B in JavaScript/TypeScript/Angular:

 const MyClass = com.example.B("com.example.MyClass", { ...... }); 

The generated output of the above will be a Java class similar to this:

package com.example;

class MyClass extends com.example.B implements com.tns.NativeScriptHashCodeProvider {
 public MyClass() { ... }

 public B methodA() { ... }

 public void methodB(B param1) { ... }

 public A methodA() { ... }

 public void methodB(A param1) { ... }

 // ... NativeScriptHashCodeProvider methods
}

Expected output:

package com.example;

class MyClass extends com.example.B implements com.tns.NativeScriptHashCodeProvider {
 public MyClass() { ... }

 public B methodA() { ... }

 public void methodB(B param1) { ... }

 // ... NativeScriptHashCodeProvider methods
}

The generated class will error out during compilation stating that there is already a method with the same signature (because B extends A).

Versions:
tns-android: 3.0.0-rc.1

@petekanev petekanev added the bug label Apr 27, 2017
@petekanev petekanev self-assigned this Apr 27, 2017
@petekanev petekanev added bug and removed bug labels Apr 27, 2017
petekanev added a commit that referenced this issue Apr 28, 2017
@petekanev
Copy link
Contributor Author

Addressed in PR #754

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

No branches or pull requests

1 participant