Return true if this can be cast to type;
type
bool canCastToType(ASTType type) => type.acceptsType(this);