IntelliJ "Unexpected symbol" 在新行上使用 elvis op 的错误

IntelliJ "Unexpected symbol" error for elvis op used on a new line

以下 groovy 代码在 IDEA 中触发错误:"Unexpected symbol: ; or newline expected"

final project = 'foo'
?: 'bar'

我在 https://groovyconsole.appspot.com/ 和本地尝试了 运行 它,代码执行正常。

问题是:它是 IDEA 中的错误还是 groovy 运行时接受无效代码?

这是一个known issue in IntelliJ IDEA. Feel free to watch/vote