FAQ

Search Discussions

1 discussions - 11 posts

  • trait Computer[A] { def compute(x:A, y:A):A } class Adder[A] extends Computer[A] { def compute(x:A, y:A): A = { x + y // 无法编译,提示类型不正确 } } 这里为什么会出现类型不正确呢?需要对x和y做类型限定吗,他们必须能做加运算?应该怎么改呢 -- 您收到此邮件是因为您订阅了 ...
    Fei WangFei Wang
    Apr 24, 2014 at 12:05 am
    Apr 28, 2014 at 10:02 am
Group Navigation
period‹ prev | Apr 2014 | next ›
Group Overview
groupscalacn @
discussions1
posts11
users6