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

If a static property and an instance property are defined on the same type, the instance property is omitted #47

Open
niloc132 opened this issue May 27, 2020 · 0 comments

Comments

@niloc132
Copy link
Contributor

(Discovered while testing #46)

Given this JS, the expected behavior presently is that _STATIC will be appended to the static version since these would otherwise collide. Instead, we see a few different behaviors, I can't yet explain what is happening here:

Example JS:

/**
 * @type {string}
 */
Foo.plainProperty;

/**
 * @type {string}
 */
Foo.prototype.plainProperty;

Resulting Java, with only one field and no _STATIC present on the static member:

  public static String plainProperty;

Example JS:

/**
 * @type {string|number}
 */
Foo.unionProperty;
/**
 * @type {string|number}
 */
Foo.prototype.unionProperty;

Resulting Java (union type omittied), correctly with two fields:

  @JsProperty(name = "unionProperty")
  public static Foo.StaticUnionPropertyUnionType unionProperty_STATIC;

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

No branches or pull requests

1 participant