Skip to content

Commit 67374c1

Browse files
committed
Order of compilation affects error message; microsoft/TypeScript#33143
1 parent dcfcdd6 commit 67374c1

File tree

4 files changed

+55
-11
lines changed

4 files changed

+55
-11
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as tsql from "../../../../../dist";
2+
/**
3+
* https://github.com/microsoft/TypeScript/issues/33143
4+
*
5+
* Seems like adding this test changes the error message of the `WHERE` clause test.
6+
*/
7+
export declare const query: tsql.Query<{
8+
fromClause: tsql.IFromClause<{
9+
outerQueryJoins: undefined;
10+
currentJoins: undefined;
11+
}>;
12+
selectClause: undefined;
13+
limitClause: undefined;
14+
unionClause: undefined;
15+
unionLimitClause: undefined;
16+
}>;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[
2+
{
3+
"messageText": {
4+
"messageText": "Type 'ExprImpl<Mapper<unknown, boolean | null>, IUsedRef<{}>>' is not assignable to type 'IExpr<{ mapper: Mapper<unknown, boolean>; usedRef: IUsedRef<{}>; }>'.",
5+
"category": 1,
6+
"code": 2322,
7+
"next": {
8+
"messageText": "Types of property 'mapper' are incompatible.",
9+
"category": 1,
10+
"code": 2326,
11+
"next": {
12+
"messageText": "Type 'Mapper<unknown, boolean | null>' is not assignable to type 'Mapper<unknown, boolean>'.",
13+
"category": 1,
14+
"code": 2322,
15+
"next": {
16+
"messageText": "Type 'boolean | null' is not assignable to type 'boolean'.",
17+
"category": 1,
18+
"code": 2322,
19+
"next": {
20+
"messageText": "Type 'null' is not assignable to type 'boolean'.",
21+
"category": 1,
22+
"code": 2322
23+
}
24+
}
25+
}
26+
}
27+
},
28+
"code": 2322,
29+
"category": 1,
30+
"length": 44,
31+
"start": 266
32+
}
33+
]

test/compile-time/expected-output/query/where/nullable-where-clause-not-allowed.ts.errors

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,7 @@
1111
"next": {
1212
"messageText": "Type 'Mapper<unknown, boolean | null>' is not assignable to type 'Mapper<unknown, boolean>'.",
1313
"category": 1,
14-
"code": 2322,
15-
"next": {
16-
"messageText": "Type 'boolean | null' is not assignable to type 'boolean'.",
17-
"category": 1,
18-
"code": 2322,
19-
"next": {
20-
"messageText": "Type 'null' is not assignable to type 'boolean'.",
21-
"category": 1,
22-
"code": 2322
23-
}
24-
}
14+
"code": 2322
2515
}
2616
}
2717
},

test/compile-time/input/query/having/nullable-where-clause-not-allowed.ts.todo renamed to test/compile-time/input/query/having/nullable-where-clause-not-allowed.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import * as tsql from "../../../../../dist";
22

3+
/**
4+
* https://github.com/microsoft/TypeScript/issues/33143
5+
*
6+
* Seems like adding this test changes the error message of the `WHERE` clause test.
7+
*/
38
export const query = tsql.QueryUtil.newInstance()
49
.having(() => tsql.and3(
510
null,

0 commit comments

Comments
 (0)