26

I can't seem to find what it does anywhere. For example say you have a method such as

def SomeFunction(a: String): String ={
       ???
}

What do the triple question marks signify?

2

2 Answers 2

39

??? is defined in Predef and simply throws a NotImplementedError:

def ??? : Nothing = throw new NotImplementedError

it has a return type of Nothing which is a sub-type of every type and can therefore be used in place of any return value.

2

While the answer given in https://stackoverflow.com/a/31302610/16372300 is technically accurate, it doesn't answer why you might come across ???, especially in tutorials and presentation. In the original question, SomeFunction is defined as a method that takes a single input of type String and returns a String. This is basically a stub, and allows you to continue coding using SomeFunction, but cannot run the code until you actually provide a definition that implements SomeFunction.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.