|
Scala example source code file (names-defaults-neg-ref.scala)
The Scala names-defaults-neg-ref.scala source code
object Test extends App {
// #2235
new A2235 with B2235
}
// only one overloaded alternative is allowed to have defaults
class A {
def foo(a: Int = 0) = a
def foo(b: String = "another") = b
}
class B {
def foo(a: Int) = a
def bar(u: String = "ldksj") = u
}
class C extends B {
override def foo(a: Int = 1092) = a
def foo(b: String = "lskdfj")
def bar(i: Int = 129083) = i
}
// #2235
trait A2235 { def f(x: Int = 1) = x }
trait B2235 { def f(x: String = "1") = x }
Other Scala examples (source code examples)Here is a short list of links related to this Scala names-defaults-neg-ref.scala source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.