Hi all,
 I create a trait and a class which extends the trait like below:
scala> trait a
defined trait a

scala> class b extends a
defined class b

scala> val c:a=new b
c: a = b...@15b2043

like polymorphism is working here.

Now consider the case,
scala> trait a
defined trait a

scala> object a{
     | class b extends a
     | }
defined module a

scala> val c:a=a
<console>:6: error: type mismatch;
 found   : a.type (with underlying type object a)
 required: a
       val c:a=a
 .....can anyone explain the reason
Thanks,
RajkumarGoel
www.twitter.com/rajkumargoel

Reply via email to