Skip to content

[Bug-Candidate]: slither fails to recognize built-in functions like type(uint8).max #2645

Open
@lum7na

Description

@lum7na

Describe the issue:

Tests were conducted using solc versions 0.8.27 and 0.8.28, and both failed to generate IR. The bug persists in the latest release. Code:

contract Test {
  function test() private returns(uint8) {
    return (type(uint8)).max;
  }
}

Run slither: slither a.sol

Output:

ERROR:SlitherSolcParsing:
Failed to generate IR for Test.test. Please open an issue https://github.com/crytic/slither/issues.
Test.test (a.sol#2-4):
        (type()(uint8)).max
Traceback (most recent call last):
...
ERROR:root:Error:
ERROR:root:type(uint8).max is unknown
ERROR:root:Please report an issue to https://github.com/crytic/slither/issues

Code example to reproduce the issue:

contract Test {
  function test() private returns(uint8) {
    return (type(uint8)).max;
  }
}

Version:

0.11.0

Relevant log output:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-candidateBugs reports that are not yet confirmed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions