Skip to content

Commit

Permalink
Fix error msg for hex number combined with unit denomination
Browse files Browse the repository at this point in the history
  • Loading branch information
pcw109550 committed Apr 8, 2024
1 parent 6040a52 commit 823c94c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
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.

0 comments on commit 823c94c

Please sign in to comment.