SM.scala:3: expected pattern type scala.Any does not conform to sequence trait scala.List
case List(y) => "zero"
^
SM.scala:3: stable identifier required, but y found.
case List(y) => "zero"
^
Exception in thread "main" java.lang.AssertionError: y
at scalac.typechecker.Analyzer.transform(Analyzer.java:1704)
at scalac.typechecker.Analyzer.transformArgs(Analyzer.java:1685)
at scalac.typechecker.Analyzer.transform(Analyzer.java:2238)
at scalac.typechecker.Analyzer.transform(Analyzer.java:1702)
at scalac.typechecker.Analyzer.transformCase(Analyzer.java:1498)
at scalac.typechecker.Analyzer.transformVisitor(Analyzer.java:1481)
at scalac.typechecker.Analyzer.transform(Analyzer.java:2222)
at scalac.typechecker.Analyzer.transform(Analyzer.java:1702)
at scalac.typechecker.Analyzer.transform(Analyzer.java:1717)
at scalac.typechecker.Analyzer.defineSym(Analyzer.java:1004)
at scalac.typechecker.Analyzer$LazyTreeType.complete(Analyzer.java:613)
at scalac.symtab.Symbol.info(Symbol.java:653)
at scalac.symtab.Symbol.initialize(Symbol.java:619)
at scalac.typechecker.Analyzer.transform(Analyzer.java:1750)
at scalac.typechecker.Analyzer.transform(Analyzer.java:1721)
at scalac.typechecker.Analyzer.transformStatSeq(Analyzer.java:1524)
at scalac.typechecker.Analyzer.transformTemplate(Analyzer.java:1583)
at scalac.typechecker.Analyzer.transform(Analyzer.java:1797)
at scalac.typechecker.Analyzer.transform(Analyzer.java:1721)
at scalac.typechecker.Analyzer.transformStatSeq(Analyzer.java:1524)
at scalac.typechecker.Analyzer.apply(Analyzer.java:111)
at scalac.ast.Transformer.apply(Transformer.java:62)
at scalac.typechecker.Analyzer.apply(Analyzer.java:59)
at scalac.typechecker.AnalyzerPhase.apply(AnalyzerPhase.java:107)
at scalac.Global.compile(Global.java:266)
at scalac.Global.compile(Global.java:245)
at scalac.Main.main(Main.java:32)
|