Skip to content

[Bug]: Compiler error when using 'error as a default parameter name in object type composition #44361

@MohamedSabthar

Description

@MohamedSabthar

Description

When composing a distinct isolated object type that defines a method with a parameter named 'error having a default value, the compiler throws the following error:

BCE2009: redeclared builtin symbol 'error'

However, renaming the parameter (e.g., from 'error to err) resolves the issue, indicating a name collision with the built-in error symbol during type composition.

Steps to Reproduce

public type A distinct isolated object {
public function close(error? 'error = ());
};

public type B distinct isolated object {
*A;
};

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions