Skip to content

Commit c443150

Browse files
committed
Add test to illustrate overloading problem.
1 parent c56c3aa commit c443150

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
trait Scope
2+
class MScope extends Scope
3+
4+
case class CI(pre: Int, decls: Scope) {
5+
def derivedCI(pre: Int) = new CI(pre, decls)
6+
def derivedCI(pre: Int = this.pre, decls: Scope = this.decls) = new CI(pre, decls)
7+
}
8+
9+
object Test {
10+
def ci = new CI(1, new MScope)
11+
val decls1 = new MScope
12+
ci.derivedCI(2, decls = decls1)
13+
ci.derivedCI(pre = 2)
14+
ci.derivedCI(decls = decls1)
15+
}

0 commit comments

Comments
 (0)