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

NumberFormatException occurs when parsing numeric literals with decimal point #487

Open
mysticfall opened this issue Apr 20, 2022 · 0 comments

Comments

@mysticfall
Copy link
Contributor

🕗 Version

0.5.8-rc.4

💻 Code or Package Name

org.jetbrains.dukat.nodeIntroduction

🙁 Actual behavior

If you try to generate Kotlin API wrappers for @babylonjs/core, it will fail with the following exception:

Exception in thread "main" java.lang.NumberFormatException: For input string: "1.5"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.base/java.lang.Integer.parseInt(Integer.java:652)
	at java.base/java.lang.Integer.parseInt(Integer.java:770)
	at org.jetbrains.dukat.nodeIntroduction.ExpressionConverter.convert(convertStatements.kt:129)
	at org.jetbrains.dukat.nodeIntroduction.ExpressionConverter.convert(convertStatements.kt:243)
	at org.jetbrains.dukat.nodeIntroduction.ExpressionConverter.convertExpression(convertStatements.kt:601)
	at org.jetbrains.dukat.nodeIntroduction.DocumentConverter.process(introduceModels.kt:523)
	at org.jetbrains.dukat.nodeIntroduction.DocumentConverter.processMembers(introduceModels.kt:271)
	at org.jetbrains.dukat.nodeIntroduction.DocumentConverter.convertToClassModel(introduceModels.kt:668)
	at org.jetbrains.dukat.nodeIntroduction.DocumentConverter.convertToModel(introduceModels.kt:728)
	at org.jetbrains.dukat.nodeIntroduction.DocumentConverter.convert(introduceModels.kt:201)
	at org.jetbrains.dukat.nodeIntroduction.NodeConverter.convert(introduceModels.kt:871)
	at org.jetbrains.dukat.nodeIntroduction.IntroduceModelsKt.introduceModels(introduceModels.kt:930)
	at org.jetbrains.dukat.ts.translator.TypescriptLowerer.lower(TypescriptLowerer.kt:98)
	at org.jetbrains.dukat.ts.translator.JsRuntimeByteArrayTranslator.lower(JsRuntimeByteArrayTranslator.kt:13)
	at org.jetbrains.dukat.ts.translator.JsRuntimeByteArrayTranslator.translate(JsRuntimeByteArrayTranslator.kt:21)
	at org.jetbrains.dukat.ts.translator.TranslateTypescriptDeclarationsKt.translateTypescriptDeclarations(translateTypescriptDeclarations.kt:10)
	at org.jetbrains.dukat.cli.CliKt.main(cli.kt:255)

🙂 Expected behavior

API wrappers get generated as expected.

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