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

Fix converting GrpaphQL Float values to Kotlin #5511

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ internal fun IrValue.codeBlock(): CodeBlock {
}

is IrFloatValue -> {
val asDouble = value.toIntOrNull()
val asDouble = value.toDoubleOrNull()
if (asDouble != null) {
// The value fits in a kotlin Double
CodeBlock.of(L, value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ internal fun IrValue.codeBlock(): CodeBlock {
}

is IrFloatValue -> {
val asDouble = value.toIntOrNull()
val asDouble = value.toDoubleOrNull()
if (asDouble != null) {
// The value fits in a kotlin Double
CodeBlock.of("%L", value)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// If you updated the codegen and test fixtures, you should commit this file too.

Test: Total LOC:
aggregate-all 197830
aggregate-kotlin-responseBased 63172
aggregate-all 197828
aggregate-kotlin-responseBased 63171
aggregate-kotlin-operationBased 40971
aggregate-kotlin-compat 0
aggregate-java-operationBased 93687
aggregate-java-operationBased 93686

java-operationBased-fragments_with_defer_and_include_directives 5590
kotlin-operationBased-fragments_with_defer_and_include_directives 3510
Expand Down Expand Up @@ -198,7 +198,7 @@ kotlin-responseBased-hero_name
kotlin-operationBased-interface_on_interface 497
kotlin-responseBased-hero_name_query_long_name 495
kotlin-responseBased-interface_always_nested 492
java-operationBased-arguments_hardcoded 489
java-operationBased-arguments_hardcoded 488
kotlin-operationBased-root_query_fragment 486
kotlin-responseBased-custom_scalar_type 484
kotlin-responseBased-variable_default_value 469
Expand Down Expand Up @@ -231,7 +231,7 @@ kotlin-operationBased-inline_fragment_simple
kotlin-responseBased-starships 384
kotlin-responseBased-java8annotation 383
kotlin-responseBased-antlr_tokens 381
kotlin-responseBased-arguments_hardcoded 372
kotlin-responseBased-arguments_hardcoded 371
kotlin-responseBased-subscriptions 371
kotlin-responseBased-enums_as_sealed 353
kotlin-responseBased-operation_id_generator 339
Expand Down