我正在尝试使用frege.java.Util
模块来构造一个Properties
实例。这是代码:
module frege_test.Application where
import frege.java.Util (Properties)
main :: [String] -> IO Int
main _ = do
properties <- Properties.new ()
return 0
那不编译,这是编译器错误:
E T:\Temp\frege-test\src\main\frege\Application.fr:7: overloaded new is ambiguos at type ()→IO t17332
It could mean one of
Properties.newα :: ∀ s.() → STMutable s Properties
Properties.newβ :: ∀ s.Mutable s Properties → STMutable s Properties
Util.Hashtable.newα :: ∀ s k v.() → STMutable s (Util.Hashtable k v)
Util.Hashtable.newβ :: ∀ s k v.Int → STMutable s (Util.Hashtable k v)
Util.Hashtable.newγ :: ∀ s k v.Int → Float → STMutable s (Util.Hashtable k v)
Util.Hashtable.newδ :: ∀ s k v.Mutable s (Util.Map k v) → STMutable s (Util.Hashtable k v)
frege_test.Application: build failed because of compilation errors.
这是怎么回事?我什至没有进口Util.Hashtable
。我该如何解决这种歧义?