```data class MyType( /** * Information [...
# announcements
j
Copy code
data class MyType(
    /**
     * Information [testing...]
     */
    val field: String,
)
I'm not sure if I have found a Kotlin bug or it's supposed to do this? But this data class results in a compiler error because of the
[testing...]
comment.
s
what’s the comma after String?
c
the comma after string is allowed with Kotlin 1.4. I repro the behaviour here - I'd guess it's a bug? https://pl.kotl.in/NpY1LuUJx
👍 2
j
That's just using the new functionality from kotlin 1.4. I'm getting a compiler error both with or without that trailing comma. The error I'm getting is
Closing bracket expected
The error points directly to the
...
in the comment also
s
Yeah I can confirm this problem
strange.
j
I have reported it as a bug here: https://youtrack.jetbrains.com/issue/KT-45516 Just not sure if it is actually a bug or it is a requirement from Kotlin to have valid references within the
[]
in comments.
s
Well, the error message is at least not helpful then if this should be the case
👍 1
@jeggy just curious
does it work if you remove the three dots (…)?
j
as long as there is 1
.
it breaks
s
haha ok
looks like a lexing issue
j
but if you have anything after the
.
then it works again
s
haha ok
n
some jetbrains dev is definitely going to have fun with this one 🙂
😛 2
(not meant sarcastically)
j
Was just surprised when my code failed and the error pointed to a comment 😆
n
all you need to do is leave a comment showing the code that crashes the compiler, so the next guy knows why it's that way
wait a second...
t
does the new IR compiler generate the same error?