The argument types of an anonymous function must be fully known. (SLS 8.5)

前端 未结 3 1710
迷失自我
迷失自我 2020-12-05 06:57

I have a function literal

{case QualifiedType(preds, ty) =>
               t.ty = ty ;
               Some((emptyEqualityConstraintSet,preds)) }
         


        
3条回答
  •  悲哀的现实
    2020-12-05 06:58

    Here's the SLS quote, for the rest of us:

    The expected type of such an expression must in part be defined. It must be either scala.Functionk[S1, . . . , Sk, R] for some k > 0, or scala.PartialFunction[S1, R], where the argument type(s) S1, . . . , Sk must be fully determined, but the result type R may be undetermined.

    Otherwise, you answered your question.

提交回复
热议问题