Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fix this compilation error on Windows:
[click to expand]
I'm guessing it only applies to Windows, otherwise CI would be failing left and right.
Related Issue
See https://discuss.kotlinlang.org/t/more-characters-allowed-for-identifiers-than-grammar-specifies-what-is-supported/2359/4. An alternative fix would've been to change
"
to'
, but I like the method name, so I opted to fix the root cause.For some (probably historical) reason
.stream()
was used to generate a list of fields to be verified. This is ok, butStream.map
is a Java function and there's a Kotlin SAM conversion taking place when it is passed a{ it.name }
which means that an anonymous local inner class is being created. Local classes have the quirk of including not only the outer class name, but also the method name. Which means that the full.class
file name includes the quotes.To alleviate this simply removing the
.stream()
call forces Kotlin to compile againstIterable<T>.map
which is a Kotlin extension function and is inline so there's no extra class created for the lambda, just a for loop.Motivation and Context
I tried to run
mvnw verify
on my computer and got a compilation error inKotlinMetaDataTest.kt
.How Has This Been Tested?
The test compiles and runs green after this change.
Types of changes
Checklist: