我正在尝试安装mercurial-server.将我的密钥添加到keys/root刷新身份验证后,我尝试克隆hgadmin-repo,但是我收到以下错误:
$ hg clone ssh://hg@<domain>/hgadmin
remote: mercurial-server: no such repository hgadmin
abort: no suitable response from remote hg!
Run Code Online (Sandbox Code Playgroud)
谁知道问题是什么?
val模式匹配时可以使用类实例的字段:
class A {
val foo = 37
def bar = 42
}
def patmat1(a: A, x: Int) {
x match {
case a.foo => println("a.foo")
case _ => println("not a.foo")
}
}
patmat1(new A, 37) // => a.foo
patmat1(new A, 42) // => not a.foo
Run Code Online (Sandbox Code Playgroud)
我想知道为什么def不能类似地使用?
def patmat2(a: A, x: Int) {
x match {
case a.bar => println("a.bar")
// ^ error: stable identifier required, but a.bar found.
case _ => println("not a.bar")
}
}
Run Code Online (Sandbox Code Playgroud)
我认为, …