Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error msg for hex number combined with unit denomination #14998

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libsolidity/analysis/TypeChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3874,7 +3874,7 @@ void TypeChecker::endVisit(Literal const& _literal)
5145_error,
_literal.location(),
"Hexadecimal numbers cannot be used with unit denominations. "
"You can use an expression of the form \"0x1234 * 1 day\" instead."
"You can use an expression of the form \"0x1234 * 1 days\" instead."
);

if (_literal.subDenomination() == Literal::SubDenomination::Year)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ contract C {
uint constant x = 0x01 wei;
}
// ----
// TypeError 5145: (32-40): Hexadecimal numbers cannot be used with unit denominations. You can use an expression of the form "0x1234 * 1 day" instead.
// TypeError 5145: (32-40): Hexadecimal numbers cannot be used with unit denominations. You can use an expression of the form "0x1234 * 1 days" instead.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ contract C {
address a = 0x11111122222333334444455555666667777788888 wei;
}
// ----
// TypeError 5145: (26-73): Hexadecimal numbers cannot be used with unit denominations. You can use an expression of the form "0x1234 * 1 day" instead.
// TypeError 5145: (26-73): Hexadecimal numbers cannot be used with unit denominations. You can use an expression of the form "0x1234 * 1 days" instead.