Scala return type for tuple-functions

Posted by Felix on Stack Overflow See other posts from Stack Overflow or by Felix
Published on 2010-04-30T10:38:01Z Indexed on 2010/04/30 11:07 UTC
Read the original article Hit count: 181

Filed under:
|
|
|
|

Hello Guys,

I want to make a scala function which returns a scala tuple.

I can do a function like this:

def foo = (1,"hello","world")

and this will work fine, but now I want to tell the compiler what I expect to be returned from the function instead of using the built in type inference (after all, I have no idea what a (1,"hello","world") is)

I thought I remembered the classname being something like Tuple3[Int,String,String] but that doesnt work for me.

Suggestions? :D

(ps: I love stack overflow!)

© Stack Overflow or respective owner

Related posts about scala

Related posts about tuples