Classes don't expose static fields from interfaces

未关闭
#16 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
java, typescript
领域
tooling

调研方向

首先追踪用于生成 Android 的 Telephony.Sms.Inbox 及其实现接口声明的实验性构建选项。将生成的 Inbox 声明与 TextBasedSmsColumns.BODY 进行比较,并确定继承的静态字段应如何出现。完成的标准是:在生成的 TypeScript 声明中可以使用 Inbox.BODY,并且此示例有覆盖。

由索引模型根据 Issue 内容生成。

描述

bug

Hi,

I'm using the aforementioned experimental build option and it is quite handy.

What I noticed though is that if there is an inheritance then it is not possible to access the base class field from the derived class. Say, Android has the Telephony.Sms.Inbox.BODY where Inbox is

public static final class Inbox implements BaseColumns, TextBasedSmsColumns

and BODY is defined in the TextBasedSmsColumns. What ends up generated is:

export class Inbox extends java.lang.Object implements android.provider.BaseColumns, android.provider.Telephony.TextBasedSmsColumns {
					public static CONTENT_URI: android.net.Uri;
					public static DEFAULT_SORT_ORDER: string;
				} 

and basically an attempt to use in a native-like way android.provider.Telephony.Sms.Inbox.BODY fails, instead I need to do android.provider.Telephony.TextBasedSmsColumns.BODY.

Something you may want to check out and some point :)

Thank you!

P.S.: also keeping the original parameter names instead of paramX would have been nice, though I guess that's in the works too :)

主要语言
Java
星标
96
派生
25
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NativeScript/android-dts-generator 的其他 Issue

查看 NativeScript/android-dts-generator 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。