Skip to content

Commit

Permalink
Fixup baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham committed Jul 13, 2022
1 parent 0db52ec commit 97bba40
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 98 deletions.
13 changes: 8 additions & 5 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15510,12 +15510,15 @@ namespace ts {
* Should all count as literals and not print errors on access or assignment of possibly existing properties.
* This mirrors the behavior of the index signature propagation, to which this behaves similarly (but doesn't affect assignability or inference).
*/
function isJSLiteralType(type: Type): boolean {
function isJSLiteralType(type: Type, context?: Node): boolean {
if (noImplicitAny(getSourceFileOfNode(context))) {
return false; // Flag is meaningless under `noImplicitAny` mode
}
if (getObjectFlags(type) & ObjectFlags.JSLiteral) {
return true;
}
if (type.flags & TypeFlags.Union) {
return every((type as UnionType).types, isJSLiteralType);
return every((type as UnionType).types, t => isJSLiteralType(t));
}
if (type.flags & TypeFlags.Intersection) {
return some((type as IntersectionType).types, isJSLiteralType);
Expand Down Expand Up @@ -15622,7 +15625,7 @@ namespace ts {
if (indexType.flags & TypeFlags.Never) {
return neverType;
}
if (isJSLiteralType(objectType)) {
if (isJSLiteralType(objectType, accessNode)) {
return anyType;
}
if (accessExpression && !isConstEnumObjectType(objectType)) {
Expand Down Expand Up @@ -15693,7 +15696,7 @@ namespace ts {
return undefined;
}
}
if (isJSLiteralType(objectType)) {
if (isJSLiteralType(objectType, accessNode)) {
return anyType;
}
if (accessNode) {
Expand Down Expand Up @@ -29231,7 +29234,7 @@ namespace ts {
getApplicableIndexInfoForName(apparentType, right.escapedText) : undefined;
if (!(indexInfo && indexInfo.type)) {
const isUncheckedJS = isUncheckedJSSuggestion(node, leftType.symbol, /*excludeClasses*/ true);
if (!isUncheckedJS && isJSLiteralType(leftType)) {
if (!isUncheckedJS && isJSLiteralType(leftType, node)) {
return anyType;
}
if (leftType.symbol === globalThisSymbol) {
Expand Down
1 change: 1 addition & 0 deletions src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1387,6 +1387,7 @@ namespace ts {
...commandOptionsWithoutBuild,
] as const);

/* @internal */
type WithTrue<T, K extends keyof T> = T extends unknown ? K extends unknown ? T[K] extends true ? T : never : never : never;

function isAffectsSemanticDiagnosticsOption<T extends CommandLineOption>(option: T): option is WithTrue<T, "affectsSemanticDiagnostics"> {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
error TS2318: Cannot find global type 'CallableFunction'.
error TS2318: Cannot find global type 'NewableFunction'.
tests/cases/conformance/jsx/file.tsx(19,17): error TS2783: 'a' is specified more than once, so this usage will be overwritten.
tests/cases/conformance/jsx/file.tsx(20,17): error TS2783: 'a' is specified more than once, so this usage will be overwritten.
Expand All @@ -10,7 +9,6 @@ tests/cases/conformance/jsx/file.tsx(22,17): error TS2783: 'a' is specified more
tests/cases/conformance/jsx/file.tsx(22,23): error TS2783: 'd' is specified more than once, so this usage will be overwritten.


!!! error TS2318: Cannot find global type 'CallableFunction'.
!!! error TS2318: Cannot find global type 'NewableFunction'.
==== tests/cases/conformance/jsx/file.tsx (8 errors) ====
import React = require('react');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,10 @@ Output::

error TS2318: Cannot find global type 'Boolean'.

error TS2318: Cannot find global type 'CallableFunction'.

error TS2318: Cannot find global type 'Function'.

error TS2318: Cannot find global type 'IArguments'.

error TS2318: Cannot find global type 'NewableFunction'.

error TS2318: Cannot find global type 'Number'.

error TS2318: Cannot find global type 'Object'.
Expand All @@ -159,7 +155,7 @@ Output::
   ~~~~~~~~
File is default library for target specified here.

[[90m12:00:40 AM[0m] Found 11 errors. Watching for file changes.
[[90m12:00:40 AM[0m] Found 9 errors. Watching for file changes.



Expand Down Expand Up @@ -269,14 +265,10 @@ Output::

error TS2318: Cannot find global type 'Boolean'.

error TS2318: Cannot find global type 'CallableFunction'.

error TS2318: Cannot find global type 'Function'.

error TS2318: Cannot find global type 'IArguments'.

error TS2318: Cannot find global type 'NewableFunction'.

error TS2318: Cannot find global type 'Number'.

error TS2318: Cannot find global type 'Object'.
Expand All @@ -294,7 +286,7 @@ Output::
   ~~~~~~~~
File is default library for target specified here.

[[90m12:00:48 AM[0m] Found 11 errors. Watching for file changes.
[[90m12:00:48 AM[0m] Found 9 errors. Watching for file changes.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,10 @@ Output::

error TS2318: Cannot find global type 'Boolean'.

error TS2318: Cannot find global type 'CallableFunction'.

error TS2318: Cannot find global type 'Function'.

error TS2318: Cannot find global type 'IArguments'.

error TS2318: Cannot find global type 'NewableFunction'.

error TS2318: Cannot find global type 'Number'.

error TS2318: Cannot find global type 'Object'.
Expand All @@ -159,7 +155,7 @@ Output::
   ~~~~~~~~
File is default library for target specified here.

[[90m12:00:46 AM[0m] Found 11 errors. Watching for file changes.
[[90m12:00:46 AM[0m] Found 9 errors. Watching for file changes.



Expand Down Expand Up @@ -269,14 +265,10 @@ Output::

error TS2318: Cannot find global type 'Boolean'.

error TS2318: Cannot find global type 'CallableFunction'.

error TS2318: Cannot find global type 'Function'.

error TS2318: Cannot find global type 'IArguments'.

error TS2318: Cannot find global type 'NewableFunction'.

error TS2318: Cannot find global type 'Number'.

error TS2318: Cannot find global type 'Object'.
Expand All @@ -294,7 +286,7 @@ Output::
   ~~~~~~~~
File is default library for target specified here.

[[90m12:00:54 AM[0m] Found 11 errors. Watching for file changes.
[[90m12:00:54 AM[0m] Found 9 errors. Watching for file changes.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,10 @@ Output::

error TS2318: Cannot find global type 'Boolean'.

error TS2318: Cannot find global type 'CallableFunction'.

error TS2318: Cannot find global type 'Function'.

error TS2318: Cannot find global type 'IArguments'.

error TS2318: Cannot find global type 'NewableFunction'.

error TS2318: Cannot find global type 'Number'.

error TS2318: Cannot find global type 'Object'.
Expand All @@ -159,7 +155,7 @@ Output::
   ~~~~~~~~
File is default library for target specified here.

[[90m12:00:36 AM[0m] Found 11 errors. Watching for file changes.
[[90m12:00:36 AM[0m] Found 9 errors. Watching for file changes.



Expand Down Expand Up @@ -261,14 +257,10 @@ Output::

error TS2318: Cannot find global type 'Boolean'.

error TS2318: Cannot find global type 'CallableFunction'.

error TS2318: Cannot find global type 'Function'.

error TS2318: Cannot find global type 'IArguments'.

error TS2318: Cannot find global type 'NewableFunction'.

error TS2318: Cannot find global type 'Number'.

error TS2318: Cannot find global type 'Object'.
Expand All @@ -286,7 +278,7 @@ Output::
   ~~~~~~~~
File is default library for target specified here.

[[90m12:00:42 AM[0m] Found 11 errors. Watching for file changes.
[[90m12:00:42 AM[0m] Found 9 errors. Watching for file changes.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,10 @@ Output::

error TS2318: Cannot find global type 'Boolean'.

error TS2318: Cannot find global type 'CallableFunction'.

error TS2318: Cannot find global type 'Function'.

error TS2318: Cannot find global type 'IArguments'.

error TS2318: Cannot find global type 'NewableFunction'.

error TS2318: Cannot find global type 'Number'.

error TS2318: Cannot find global type 'Object'.
Expand All @@ -159,7 +155,7 @@ Output::
   ~~~~~~~~
File is default library for target specified here.

[[90m12:00:31 AM[0m] Found 11 errors. Watching for file changes.
[[90m12:00:31 AM[0m] Found 9 errors. Watching for file changes.



Expand Down Expand Up @@ -256,14 +252,10 @@ Output::

error TS2318: Cannot find global type 'Boolean'.

error TS2318: Cannot find global type 'CallableFunction'.

error TS2318: Cannot find global type 'Function'.

error TS2318: Cannot find global type 'IArguments'.

error TS2318: Cannot find global type 'NewableFunction'.

error TS2318: Cannot find global type 'Number'.

error TS2318: Cannot find global type 'Object'.
Expand All @@ -281,7 +273,7 @@ Output::
   ~~~~~~~~
File is default library for target specified here.

[[90m12:00:38 AM[0m] Found 11 errors. Watching for file changes.
[[90m12:00:38 AM[0m] Found 9 errors. Watching for file changes.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,10 @@ Output::

error TS2318: Cannot find global type 'Boolean'.

error TS2318: Cannot find global type 'CallableFunction'.

error TS2318: Cannot find global type 'Function'.

error TS2318: Cannot find global type 'IArguments'.

error TS2318: Cannot find global type 'NewableFunction'.

error TS2318: Cannot find global type 'Number'.

error TS2318: Cannot find global type 'Object'.
Expand All @@ -159,7 +155,7 @@ Output::
   ~~~~~~~~
File is default library for target specified here.

[[90m12:00:34 AM[0m] Found 11 errors. Watching for file changes.
[[90m12:00:34 AM[0m] Found 9 errors. Watching for file changes.



Expand Down Expand Up @@ -269,14 +265,10 @@ Output::

error TS2318: Cannot find global type 'Boolean'.

error TS2318: Cannot find global type 'CallableFunction'.

error TS2318: Cannot find global type 'Function'.

error TS2318: Cannot find global type 'IArguments'.

error TS2318: Cannot find global type 'NewableFunction'.

error TS2318: Cannot find global type 'Number'.

error TS2318: Cannot find global type 'Object'.
Expand All @@ -294,7 +286,7 @@ Output::
   ~~~~~~~~
File is default library for target specified here.

[[90m12:00:42 AM[0m] Found 11 errors. Watching for file changes.
[[90m12:00:42 AM[0m] Found 9 errors. Watching for file changes.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,10 @@ Output::

error TS2318: Cannot find global type 'Boolean'.

error TS2318: Cannot find global type 'CallableFunction'.

error TS2318: Cannot find global type 'Function'.

error TS2318: Cannot find global type 'IArguments'.

error TS2318: Cannot find global type 'NewableFunction'.

error TS2318: Cannot find global type 'Number'.

error TS2318: Cannot find global type 'Object'.
Expand All @@ -159,7 +155,7 @@ Output::
   ~~~~~~~~
File is default library for target specified here.

[[90m12:00:30 AM[0m] Found 11 errors. Watching for file changes.
[[90m12:00:30 AM[0m] Found 9 errors. Watching for file changes.



Expand Down Expand Up @@ -261,14 +257,10 @@ Output::

error TS2318: Cannot find global type 'Boolean'.

error TS2318: Cannot find global type 'CallableFunction'.

error TS2318: Cannot find global type 'Function'.

error TS2318: Cannot find global type 'IArguments'.

error TS2318: Cannot find global type 'NewableFunction'.

error TS2318: Cannot find global type 'Number'.

error TS2318: Cannot find global type 'Object'.
Expand All @@ -286,7 +278,7 @@ Output::
   ~~~~~~~~
File is default library for target specified here.

[[90m12:00:36 AM[0m] Found 11 errors. Watching for file changes.
[[90m12:00:36 AM[0m] Found 9 errors. Watching for file changes.



Expand Down

0 comments on commit 97bba40

Please sign in to comment.