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

Android d.ts generator fails to create typings for nested data class #1754

Open
CatchABus opened this issue Apr 6, 2023 · 0 comments
Open

Comments

@CatchABus
Copy link

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 8.5
  • Cross-platform modules: 8.5.0
  • Android Runtime: 8.5.0
  • Android d.ts Generator : 3.0.0
  • iOS Runtime (if applicable): 8.5.1
  • Plugin(s):

Describe the bug
It seems Android d.ts generator has trouble generating types for data classes declared inside functions.
Generator log output:

Android d.ts Generator Version : 3.0.0
ignoring definitions in missing dependency: android.text.TextWatcher
ignoring definitions in missing dependency: android.view.View$OnFocusChangeListener
Generation of definitions took 712ms.
Typings have been generated in the following directory: ./typings

To Reproduce
This is the kotlin function with class declaration: https://github.com/RedMadRobot/input-mask-android/blob/eee78324eb4cdb4faab3248ef646d5750507b598/inputmask/src/main/kotlin/com/redmadrobot/inputmask/MaskedTextChangedListener.kt#L294

These are the typings generated, you will notice a brace is missing on module pickMask:

export module MaskedTextChangedListener {
	export module pickMask {
	export module ValueListener {
		export class MaskAffinity {
			public static class: java.lang.Class<com.redmadrobot.inputmask.MaskedTextChangedListener.pickMask.MaskAffinity>;
			public component1(): com.redmadrobot.inputmask.helper.Mask;
			public getAffinity(): number;
			public component2(): number;
			public copy(param0: com.redmadrobot.inputmask.helper.Mask, param1: number): com.redmadrobot.inputmask.MaskedTextChangedListener.pickMask.MaskAffinity;
			public hashCode(): number;
			public equals(param0: any): boolean;
			public getMask(): com.redmadrobot.inputmask.helper.Mask;
			public toString(): string;
			public constructor(param0: com.redmadrobot.inputmask.helper.Mask, param1: number);
		}
	}
}

Expected behavior
Typings should be generated without problems.

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