Skip to content

Commit b643e5c

Browse files
committed
re-add checks for pseudomains to strict files
1 parent de252df commit b643e5c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/CodegenFile.hack

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,10 @@ final class CodegenFile {
409409

410410
$header = $this->pseudoMainHeader;
411411
if ($header !== null) {
412+
invariant(
413+
$this->fileType !== CodegenFileType::HACK_STRICT,
414+
'Pseudomains (and pseudomain headers) are not supported in strict files'
415+
);
412416
$builder->ensureNewLine()->add($header)->ensureNewLine();
413417
}
414418

@@ -444,6 +448,10 @@ final class CodegenFile {
444448

445449
$footer = $this->pseudoMainFooter;
446450
if ($footer !== null) {
451+
invariant(
452+
$this->fileType !== CodegenFileType::HACK_STRICT,
453+
'Pseudomains (and pseudomain footers) are not supported in strict files'
454+
);
447455
$builder->ensureEmptyLine()->add($footer)->ensureNewLine();
448456
}
449457
return $builder->getCode();

0 commit comments

Comments
 (0)