Aladdin - Scala Bugtracking
[#1156] project: compiler priority: low category: missing feature
submitter assigned to status date submitted
Nikolay Martin noise 2007-05-30 13:29:19.0
subject [contrib #586] type inference with multiple ParamClauses
code
// In a call of s[T](x: T)(y: T)
// the type of argument y isn't being considered when determining T
// Perhaps this is intentional, I'm not sure.

class B {}

class D extends B {}

object Test extends Application
{
    def p[T](y: T, x: T): Unit = {}
    def q[T](y: T)(x: T): Unit = {}
    def r[T](x: T, y: T): Unit = {}
    def s[T](x: T)(y: T): Unit = {}

    val b = new B
    val d = new D

    p(b, d)
    q(b)(d)
    r(d, b)
    s(d)(b)
}
what happened
error: type mismatch;
 found   : B
 required: D
    s(d)(b)
         ^

what expected successful compilation
[back to overview]
Changes of this bug report
Nikolay  edited on  2007-05-30 13:29:41.0
Martin  edited on  2007-05-30 18:21:08.0
It is intentional. For a curried application only the first parameter list counts.