1
對於此類型:定義的元組類型
val t : (String, Array[((String, String), Double)]) = ("a", Array((("a", "b"), 1.0), (("a", "c"), 2.0)))
應該我不能也使用了這種類型的定義:
val t : Tuple2[String , Array[Tuple2[[String , String] , Double]]] = ("a", Array((("a", "b"), 1.0), (("a", "c"), 2.0)))
但收到此錯誤:
Multiple markers at this line - identifier expected but '[' found. - wrong number of type arguments for Tuple2,
should be 2 - only classes can have declared but undefined members
是Tuple2 (或TupleN)定義類型時不允許?
你缺少一個'Tuple2'。 –