I am learning scala and I've noticed that the following line of code doesn't work
val worldFreq = ("India", 1) :: ("US", 2) :: ("Berlin", 10)
Results in the error : error: value :: is not a member of (String, Int) val worldFreq = ("India", 1) :: ("US", 2) :: ("Berlin", 10)
However this line of code works perfectly
val worldFreq = ("India", 1) :: ("US", 2) :: ("Berlin", 10) :: Nil
worldFreq: List[(String, Int)] = List((India,1), (US,2), (Berlin,10))
Can someone help me understand the error message and the fact the it works with Nil.