**How to reproduce**
* Working query
```sql
WITH arrayJoin(range(2)) AS delta
SELECT
    toDate(time) + toIntervalDay(delta) AS dt,
    version()
FROM 
(
    SELECT NOW() AS time
)

┌─────────dt─┬─version()──┐
│ 2020-11-01 │ 20.10.3.30 │
│ 2020-11-02 │ 20.10.3.30 │
└────────────┴────────────┘

2 rows in set. Elapsed: 0.006 sec. 

```

* After adding ORDER BY dt
```sql
WITH arrayJoin(range(2)) AS delta
SELECT
    toDate(time) + toIntervalDay(delta) AS dt,
    version()
FROM 
(
    SELECT NOW() AS time
)
ORDER BY dt ASC


Received exception from server (version 20.10.3):
Code: 43. DB::Exception: Received from localhost:9000. DB::Exception: Illegal type Date of argument of function range. 

0 rows in set. Elapsed: 0.022 sec. 
```
* Try to change range(2) to equivalent array [0,1]
```sql
WITH arrayJoin([0, 1]) AS delta
SELECT
    toDate(time) + toIntervalDay(delta) AS dt,
    version()
FROM 
(
    SELECT NOW() AS time
)
ORDER BY dt ASC


Received exception from server (version 20.10.3):
Code: 43. DB::Exception: Received from localhost:9000. DB::Exception: Argument for function arrayJoin must be Array.. 

0 rows in set. Elapsed: 0.004 sec. 
```

**Expected behavior**
Correctly ordered result set

**Additional context**
Both queries with errors correctly run on version 20.7.2.30 
```sql
WITH arrayJoin(range(2)) AS delta
SELECT 
    toDate(time) + toIntervalDay(delta) AS dt,
    version()
FROM 
(
    SELECT NOW() AS time
)
ORDER BY dt ASC

┌─────────dt─┬─version()─┐
│ 2020-11-01 │ 20.7.2.30 │
│ 2020-11-02 │ 20.7.2.30 │
└────────────┴───────────┘

2 rows in set. Elapsed: 0.003 sec. 
```
```sql
WITH arrayJoin([0, 1]) AS delta
SELECT 
    toDate(time) + toIntervalDay(delta) AS dt,
    version()
FROM 
(
    SELECT NOW() AS time
)
ORDER BY dt ASC

┌─────────dt─┬─version()─┐
│ 2020-11-01 │ 20.7.2.30 │
│ 2020-11-02 │ 20.7.2.30 │
└────────────┴───────────┘

2 rows in set. Elapsed: 0.001 sec. 
```


return;
        }
        
        if (!data.arg_data_type && !data.extractIdentifierAndType(ast_function))
        {
            data.reject();
            return;
        }
        ColumnsWithTypeAndName args;
        args.emplace_back(data.arg_data_type, "tmp");
        auto function_base = function->build(args);
        if (function_base && function_base->hasInformationAboutMonotonicity())
        {
            bool is_positive = data.monotonicity.is_positive;
            data.monotonicity = function_base->getMonotonicityForRange(*data.arg_data_type, Field(), Field());
            if (!is_positive)
                data.monotonicity.is_positive = !data.monotonicity.is_positive;
            data.arg_data_type = function_base->getResultType();
        }
        else
            data.reject();
    }
    static bool needChildVisit(const ASTPtr &, const ASTPtr &)
    {
        return true;
    }
};
using MonotonicityCheckVisitor = ConstInDepthNodeVisitor<MonotonicityCheckMatcher, false>;
}