Skip to content

Commit f4f3a20

Browse files
committed
Invert check, no bamboozle
1 parent 36b321f commit f4f3a20

File tree

3 files changed

+17
-47
lines changed

3 files changed

+17
-47
lines changed

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4796,7 +4796,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
47964796
}
47974797

47984798
function verifyProjectReferences() {
4799-
const buildInfoPath = some(internalOptionDeclarations, d => hasProperty(options, d.name)) ? getTsBuildInfoEmitOutputFilePath(options) : undefined;
4799+
const buildInfoPath = !some(internalOptionDeclarations, d => hasProperty(options, d.name)) ? getTsBuildInfoEmitOutputFilePath(options) : undefined;
48004800
forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, parent, index) => {
48014801
const ref = (parent ? parent.commandLine.projectReferences : projectReferences)![index];
48024802
const parentFile = parent && parent.sourceFile as JsonSourceFile;

tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -73,36 +73,21 @@ Output::
7373

7474
[12:00:26 AM] Building project '/src/src/main/tsconfig.json'...
7575

76-
error TS5033: Could not write file '/src/dist/tsconfig.tsbuildinfo': Debug Failure. False expression..
76+
src/src/main/tsconfig.json:4:5 - error TS6377: Cannot write file '/src/dist/tsconfig.tsbuildinfo' because it will overwrite '.tsbuildinfo' file generated by referenced project '/src/src/other'
77+
78+
4 {
79+
   ~
80+
5 "path": "../other"
81+
  ~~~~~~~~~~~~~~~~~~~~~~~~
82+
6 }
83+
  ~~~~~
7784

7885

7986
Found 1 error.
8087

8188
exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated
8289

8390

84-
//// [/src/dist/a.d.ts]
85-
export {};
86-
87-
88-
//// [/src/dist/a.js]
89-
"use strict";
90-
Object.defineProperty(exports, "__esModule", { value: true });
91-
var b_1 = require("./b");
92-
var a = b_1.b;
93-
94-
95-
//// [/src/dist/b.d.ts]
96-
export declare const b = 0;
97-
98-
99-
//// [/src/dist/b.js]
100-
"use strict";
101-
Object.defineProperty(exports, "__esModule", { value: true });
102-
exports.b = void 0;
103-
exports.b = 0;
104-
105-
10691
//// [/src/dist/other.d.ts]
10792
export declare const Other = 0;
10893

tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file.js

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -79,36 +79,21 @@ Output::
7979

8080
[12:00:27 AM] Building project '/src/src/main/tsconfig.json'...
8181

82-
error TS5033: Could not write file '/src/dist/tsconfig.tsbuildinfo': Debug Failure. False expression..
82+
src/src/main/tsconfig.json:7:5 - error TS6377: Cannot write file '/src/dist/tsconfig.tsbuildinfo' because it will overwrite '.tsbuildinfo' file generated by referenced project '/src/src/other'
83+
84+
7 {
85+
   ~
86+
8 "path": "../other"
87+
  ~~~~~~~~~~~~~~~~~~~~~~~~
88+
9 }
89+
  ~~~~~
8390

8491

8592
Found 1 error.
8693

8794
exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated
8895

8996

90-
//// [/src/dist/a.d.ts]
91-
export {};
92-
93-
94-
//// [/src/dist/a.js]
95-
"use strict";
96-
Object.defineProperty(exports, "__esModule", { value: true });
97-
var b_1 = require("./b");
98-
var a = b_1.b;
99-
100-
101-
//// [/src/dist/b.d.ts]
102-
export declare const b = 0;
103-
104-
105-
//// [/src/dist/b.js]
106-
"use strict";
107-
Object.defineProperty(exports, "__esModule", { value: true });
108-
exports.b = void 0;
109-
exports.b = 0;
110-
111-
11297
//// [/src/dist/other.d.ts]
11398
export declare const Other = 0;
11499

0 commit comments

Comments
 (0)