Skip to content

One error code in ABI for panics in functions of same name and content #7386

@ironcev

Description

@ironcev

Steps to reproduce: create a script project with these two files:

// module.sw
library;

struct S {}

impl S {
    fn function() {
        panic "This is an error message.";
    }
}

fn function() {
    panic "This is an error message.";
}

pub fn module_main() {
    function();
    S::function();
}
script;

mod module;

struct S {}

impl S {
    fn function() {
        panic "This is an error message.";
    }
}

fn function() {
    panic "This is an error message.";
}

fn main() {
    function();
    S::function();
    module::module_main();
}

When compiling the script, only one error code will be created, for the first function that gets compiled.

"errorCodes": {
    "0": {
      "pos": {
        "function": "same_fn_issue::function",
        "pkg": "same_fn_issue",
        "file": "src/main.sw",
        "line": 14,
        "column": 5
      },
      "logId": null,
      "msg": "This is an error message."
    }
},

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcompilerGeneral compiler. Should eventually become more specific as the issue is triagedcompiler: irIRgen and sway-ir including optimization passesteam:compilerCompiler Team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions