Skip to content

Commit

Permalink
Order of compilation affects error message; microsoft/TypeScript#33143
Browse files Browse the repository at this point in the history
  • Loading branch information
AnyhowStep committed Aug 29, 2019
1 parent dcfcdd6 commit 67374c1
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as tsql from "../../../../../dist";
/**
* https://github.com/microsoft/TypeScript/issues/33143
*
* Seems like adding this test changes the error message of the `WHERE` clause test.
*/
export declare const query: tsql.Query<{
fromClause: tsql.IFromClause<{
outerQueryJoins: undefined;
currentJoins: undefined;
}>;
selectClause: undefined;
limitClause: undefined;
unionClause: undefined;
unionLimitClause: undefined;
}>;

This comment has been minimized.

Copy link
@AnyhowStep

AnyhowStep Sep 4, 2019

Author Owner

The .d.ts of the new test. No problems here

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[
{
"messageText": {
"messageText": "Type 'ExprImpl<Mapper<unknown, boolean | null>, IUsedRef<{}>>' is not assignable to type 'IExpr<{ mapper: Mapper<unknown, boolean>; usedRef: IUsedRef<{}>; }>'.",
"category": 1,
"code": 2322,
"next": {
"messageText": "Types of property 'mapper' are incompatible.",
"category": 1,
"code": 2326,
"next": {
"messageText": "Type 'Mapper<unknown, boolean | null>' is not assignable to type 'Mapper<unknown, boolean>'.",
"category": 1,
"code": 2322,
"next": {
"messageText": "Type 'boolean | null' is not assignable to type 'boolean'.",
"category": 1,
"code": 2322,
"next": {
"messageText": "Type 'null' is not assignable to type 'boolean'.",

This comment has been minimized.

Copy link
@AnyhowStep

AnyhowStep Aug 29, 2019

Author Owner

This contains the expected error message of the new test, with nothing removed.

"category": 1,
"code": 2322
}
}
}
}
},
"code": 2322,
"category": 1,
"length": 44,
"start": 266
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,7 @@
"next": {
"messageText": "Type 'Mapper<unknown, boolean | null>' is not assignable to type 'Mapper<unknown, boolean>'.",
"category": 1,
"code": 2322,
"next": {
"messageText": "Type 'boolean | null' is not assignable to type 'boolean'.",
"category": 1,
"code": 2322,
"next": {
"messageText": "Type 'null' is not assignable to type 'boolean'.",

This comment has been minimized.

Copy link
@AnyhowStep

AnyhowStep Aug 29, 2019

Author Owner

These error messages get removed for some reason.

This comment has been minimized.

Copy link
@AnyhowStep

AnyhowStep Sep 4, 2019

Author Owner

Just learned it's because of error deduplication, even though they're in different files.

Seems like this happens for batch compilation

"category": 1,
"code": 2322
}
}
"code": 2322
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import * as tsql from "../../../../../dist";

/**
* https://github.com/microsoft/TypeScript/issues/33143
*
* Seems like adding this test changes the error message of the `WHERE` clause test.
*/
export const query = tsql.QueryUtil.newInstance()
.having(() => tsql.and3(

This comment has been minimized.

Copy link
@AnyhowStep

AnyhowStep Aug 29, 2019

Author Owner

This is the new test

null,
Expand Down

0 comments on commit 67374c1

Please sign in to comment.