Skip to content

Commit

Permalink
Merge pull request #14998 from pcw109550/pcw109550/fix-err-msg-days-h…
Browse files Browse the repository at this point in the history
…ex-number-combination

Fix error msg for hex number combined with unit denomination
  • Loading branch information
cameel committed Apr 9, 2024
2 parents 2bc657a + 0c32ddb commit ae9bcab
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 ae9bcab

Please sign in to comment.