softshipper
softshipper

Reputation: 34081

Triple question mark in Kotlin?

In Scala you can delay the implementation with triple question mark as:

def doSomething(s: String): Int = ???

Does Kotlin support such as feature?

Upvotes: 4

Views: 431

Answers (1)

user
user

Reputation: 7604

There's a TODO function that does something similar. You can either call it with a string that gives a reason for it being unimplemented, or you can just say TODO() with no arguments. The return type is Nothing, but it will throw a NotImplementedError (just like ??? in Scala), as Jörg W Mittag pointed out.

Upvotes: 8

Related Questions