Why does put RaycastHit2D type to boolean variable in 2D platformer Demo?

I study 2D tutorial from Official 2D platformer which is downloaded from asstes store.In the playercontrol script, i am confused with some codes , like the following picture:
[28959-qq截图20140710131416.png|28959]

the grounded is a bool type , the Physics2D.Linecast should return RaycastHit2D type , why does the retuen value assigne to grounded that is a boolean type ?
There is no compiler error .
Is there something wrong with the demo code ?
any one can help me ?

RaycastHit2D has an implicit conversion to bool. You can say “if(hits){…}” where hits is RaycastHit2D.

Here they say “RaycastHit2D implements an implicit conversion operator converting to bool which checks this property allowing it to be used as a simple condition check for whether a hit occurred or not.”.