Skip to content

[Bug]: Invalid type assigned to literals #1688

Open
@Shungy

Description

@Shungy

Describe the issue:

It appears that IR considers literals as uint256 or int256 type, but they should be assigned the smallest possible type instead.

Code example to reproduce the issue:

	function test5(uint40 x) external view returns (uint256 res) {
		res = x * 50;
	}

50 should be uint8, but ir.variable_right.type returns uint256.

Version:

0.9.2

Relevant log output:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingir

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions