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

Improve default function representation in trace #523

Merged

Conversation

bbrockbernd
Copy link
Collaborator

Improves representation of function with default values. This is done by collapsing the double invocation into a single one.
Closes #511
Changes:

| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                                                                                               Thread 1                                                                                                |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| operation()                                                                                                                                                                                           |
|   FunctionWithDefaultFieldsReprTest.callMe$default(FunctionWithDefaultFieldsReprTest#1, 3, null, 2, null) at FunctionWithDefaultFieldsReprTest.operation(FunctionWithDefaultFieldsReprTest.kt:20)     |
|     FunctionWithDefaultFieldsReprTest#1.callMe(3, "Hey") at FunctionWithDefaultFieldsReprTest.callMe$default(FunctionWithDefaultFieldsReprTest.kt:24)                                                 |
|       a ➜ 0 at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:25)                                                                                                      |
|       a = 3 at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:25)                                                                                                      |
|       a ➜ 3 at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:26)                                                                                                      |
|       a = 6 at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:26)                                                                                                      |
|       FunctionWithDefaultFieldsReprTest.callOther$default(FunctionWithDefaultFieldsReprTest#1, 5, null, 2, null) at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:27) |
|         FunctionWithDefaultFieldsReprTest#1.callOther(5, "Hey") at FunctionWithDefaultFieldsReprTest.callOther$default(FunctionWithDefaultFieldsReprTest.kt:30)                                       |
|           a ➜ 6 at FunctionWithDefaultFieldsReprTest.callOther(FunctionWithDefaultFieldsReprTest.kt:31)                                                                                               |
|           a = 9 at FunctionWithDefaultFieldsReprTest.callOther(FunctionWithDefaultFieldsReprTest.kt:31)                                                                                               |
|           a ➜ 9 at FunctionWithDefaultFieldsReprTest.callOther(FunctionWithDefaultFieldsReprTest.kt:32)                                                                                               |
|           a = 14 at FunctionWithDefaultFieldsReprTest.callOther(FunctionWithDefaultFieldsReprTest.kt:32)                                                                                              |
|   FunctionWithDefaultFieldsReprTest.callMe$default(FunctionWithDefaultFieldsReprTest#1, 0, null, 3, null) at FunctionWithDefaultFieldsReprTest.operation(FunctionWithDefaultFieldsReprTest.kt:21)     |
|     FunctionWithDefaultFieldsReprTest#1.callMe(1, "Hey") at FunctionWithDefaultFieldsReprTest.callMe$default(FunctionWithDefaultFieldsReprTest.kt:24)                                                 |
|       a ➜ 14 at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:25)                                                                                                     |
|       a = 17 at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:25)                                                                                                     |
|       a ➜ 17 at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:26)                                                                                                     |
|       a = 18 at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:26)                                                                                                     |
|       FunctionWithDefaultFieldsReprTest.callOther$default(FunctionWithDefaultFieldsReprTest#1, 5, null, 2, null) at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:27) |
|         FunctionWithDefaultFieldsReprTest#1.callOther(5, "Hey") at FunctionWithDefaultFieldsReprTest.callOther$default(FunctionWithDefaultFieldsReprTest.kt:30)                                       |
|           a ➜ 18 at FunctionWithDefaultFieldsReprTest.callOther(FunctionWithDefaultFieldsReprTest.kt:31)                                                                                              |
|           a = 21 at FunctionWithDefaultFieldsReprTest.callOther(FunctionWithDefaultFieldsReprTest.kt:31)                                                                                              |
|           a ➜ 21 at FunctionWithDefaultFieldsReprTest.callOther(FunctionWithDefaultFieldsReprTest.kt:32)                                                                                              |
|           a = 26 at FunctionWithDefaultFieldsReprTest.callOther(FunctionWithDefaultFieldsReprTest.kt:32)                                                                                              |
|   result: void                                                                                                                                                                                        |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

To:

| ---------------------------------------------------------------------------------------------------------------------------------------------- |
|                                                                    Thread 1                                                                    |
| ---------------------------------------------------------------------------------------------------------------------------------------------- |
| operation()                                                                                                                                    |
|   FunctionWithDefaultFieldsReprTest.callMe(3, "Hey") at FunctionWithDefaultFieldsReprTest.operation(FunctionWithDefaultFieldsReprTest.kt:23)   |
|     a ➜ 0 at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:28)                                                 |
|     a = 3 at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:28)                                                 |
|     a ➜ 3 at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:29)                                                 |
|     a = 6 at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:29)                                                 |
|     FunctionWithDefaultFieldsReprTest.callOther(5, "Hey") at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:30) |
|       a ➜ 6 at FunctionWithDefaultFieldsReprTest.callOther(FunctionWithDefaultFieldsReprTest.kt:35)                                            |
|       a = 9 at FunctionWithDefaultFieldsReprTest.callOther(FunctionWithDefaultFieldsReprTest.kt:35)                                            |
|       a ➜ 9 at FunctionWithDefaultFieldsReprTest.callOther(FunctionWithDefaultFieldsReprTest.kt:36)                                            |
|       a = 14 at FunctionWithDefaultFieldsReprTest.callOther(FunctionWithDefaultFieldsReprTest.kt:36)                                           |
|   FunctionWithDefaultFieldsReprTest.callMe(1, "Hey") at FunctionWithDefaultFieldsReprTest.operation(FunctionWithDefaultFieldsReprTest.kt:24)   |
|     a ➜ 14 at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:28)                                                |
|     a = 17 at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:28)                                                |
|     a ➜ 17 at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:29)                                                |
|     a = 18 at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:29)                                                |
|     FunctionWithDefaultFieldsReprTest.callOther(5, "Hey") at FunctionWithDefaultFieldsReprTest.callMe(FunctionWithDefaultFieldsReprTest.kt:30) |
|       a ➜ 18 at FunctionWithDefaultFieldsReprTest.callOther(FunctionWithDefaultFieldsReprTest.kt:35)                                           |
|       a = 21 at FunctionWithDefaultFieldsReprTest.callOther(FunctionWithDefaultFieldsReprTest.kt:35)                                           |
|       a ➜ 21 at FunctionWithDefaultFieldsReprTest.callOther(FunctionWithDefaultFieldsReprTest.kt:36)                                           |
|       a = 26 at FunctionWithDefaultFieldsReprTest.callOther(FunctionWithDefaultFieldsReprTest.kt:36)                                           |
|   result: void                                                                                                                                 |
| ---------------------------------------------------------------------------------------------------------------------------------------------- |

@bbrockbernd bbrockbernd requested review from eupp and ndkoval February 12, 2025 13:16
@ndkoval ndkoval removed their request for review February 12, 2025 16:42
@bbrockbernd bbrockbernd requested a review from eupp February 13, 2025 08:53
@bbrockbernd bbrockbernd requested a review from eupp February 13, 2025 14:06
Copy link
Collaborator

@eupp eupp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the last one minor comment, otherwise looks good to me.

@bbrockbernd bbrockbernd merged commit f3553d2 into develop Feb 14, 2025
20 checks passed
@bbrockbernd bbrockbernd deleted the bbrockbernd/improve-default-function-representation branch February 14, 2025 10:36
@bbrockbernd bbrockbernd linked an issue Feb 14, 2025 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

Improve representation of Kotlin functions with default arguments
2 participants