Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
Make the version error correct using \HHVM_VERSION (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
lexidor authored Apr 16, 2020
1 parent d9a772b commit 64badd6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions codegen/version.hack

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions src/SchemaVersionError.hack
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ final class SchemaVersionError extends ParseError {
$targetFile,
null,
Str\format(
"AST version mismatch: expected '%s' (%d.%d.%d), but got '%s'",
"AST version mismatch: expected '%s' (%s), but got '%s'",
SCHEMA_VERSION,
\intdiv(HHVM_VERSION_ID, 10000),
\intdiv(HHVM_VERSION_ID, 100) % 100,
HHVM_VERSION_ID % 100,
HHVM_VERSION,
$version,
),
);
Expand Down
5 changes: 5 additions & 0 deletions src/__Private/codegen/CodegenVersion.hack
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ final class CodegenVersion extends CodegenBase {
->setType('int')
->setValue(\HHVM_VERSION_ID, HackBuilderValues::export()),
)
->addConstant(
$cg->codegenConstant('HHVM_VERSION')
->setType('string')
->setValue(\HHVM_VERSION, HackBuilderValues::export()),
)
->save();
}
}

0 comments on commit 64badd6

Please sign in to comment.