本文介绍了Set4在Scala 2.9.1中的奇怪行为?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从2.8.1迁移到2.9.1的过程很有趣.试图在控制台中编写此代码:

Making a migration from 2.8.1 to 2.9.1 found interesting thing.Tried to write this in console:

>>import collection.immutable.Set.Set4
>>new Set4[Int](1,2,3,4)

它给出:

java.lang.Error: Unexpected New
    at scala.tools.nsc.symtab.SymbolTable.abort(SymbolTable.scala:34)
    at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$bac
..........................
That entry seems to have slain the compiler.  Shall I replayscala:660)
your session? I can re-run each line except the last one.reach(ListBuffer.scala:
[y/n]?

我正在使用Scala 2.9.1.final版本(Java HotSpot(TM)客户端VM,Java 1.6.0_26).
类Set3和Set2也会发生同样的事情.
这些是已知问题吗?
或者,也许我做错了什么?
在scala 2.8.1控制台中,它可以正常工作并返回:

I am using Scala version 2.9.1.final (Java HotSpot(TM) Client VM, Java 1.6.0_26).
And same things happen with classes Set3 and Set2.
Are these known issues?
Or, maybe, I am making something wrong?
In scala 2.8.1 console it works, and returns:

res0: collection.immutable.Set.Set4[Int] = Set(1,2,3,4)

我必须将这些报告为错误吗?

Must I report about these as bug?

推荐答案

是.这是一个编译器错误,请继续进行报告.

Yes. This is a compiler bug, go ahead and report it.

这篇关于Set4在Scala 2.9.1中的奇怪行为?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 11:38