Skip to content

Conversation

@dipanshuhappy
Copy link
Contributor

Resolves #640
When I run solc on the test case the error message was

TypeError: Type literal_string "ab" is not implicitly convertible to expected type bytes1. Literal is larger than the type.

Solar was giving

mismatched types

Happy to work on making the error more descriptive on another issue. If so let me know

@DaniPopes DaniPopes changed the title Feat(sema) implicit bytes literal conversion to bytes dynamic/fixed feat(sema): implicit bytes literal conversion to bytes dynamic/fixed Dec 16, 2025
@DaniPopes
Copy link
Member

You can merge main and you'll have an error enum you can add a variant to improve the error message

if size_from.bytes() <= size_to.bytes() {
Ok(())
} else {
Result::Err(TyConvertError::InvalidConversion)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a new variant to match the solc error message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bytes literal implicit conversion

2 participants