How to write multi-line properties on the REPL?

How can I write an extension property like the following on the REPL (kotlinc in a terminal)?

val String?.isTrue: Boolean
  get() = !this.isNullOrBlank()

The problem is that getter goes to the next line, but then the statement is considered to be finished and the compiler tells me:

error: property must be initialized or be abstract
val String.isTrue: Boolean

How can I enter this syntax?

1 Like