fork download
  1. import scala.collection.mutable.Map
  2.  
  3. object Main extends App {
  4. var x = Map[Int, Map[Int, Int]]();
  5. x(1)(2) = 3
  6. println(x(1)(2));
  7. }
Runtime error #stdin #stdout #stderr 0.28s 322240KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.util.NoSuchElementException: key not found: 1
	at scala.collection.MapLike$class.default(MapLike.scala:228)
	at scala.collection.AbstractMap.default(Map.scala:59)
	at scala.collection.mutable.HashMap.apply(HashMap.scala:65)
	at Main$.delayedEndpoint$Main$1(Main.scala:5)
	at Main$delayedInit$body.apply(Main.scala:3)
	at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
	at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
	at scala.App$$anonfun$main$1.apply(App.scala:76)
	at scala.App$$anonfun$main$1.apply(App.scala:76)
	at scala.collection.immutable.List.foreach(List.scala:381)
	at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
	at scala.App$class.main(App.scala:76)
	at Main$.main(Main.scala:3)
	at Main.main(Main.scala)