Skip to content

Bogus compiler error with DEFINEs in default parameter values in /shared mode #1970

@cpyrgas

Description

@cpyrgas

Very often (more than 50% in my machine) when compiling the following piece of code in /shared compiler mode, the compiler reports a bogus error XS0182: An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type

When compiling without /shared, the error is never reported

PROCEDURE TestProc1()
PROCEDURE TestProc2() CLIPPER

FUNCTION Start() AS VOID STRICT

DEFINE DDD := 100 AS INT
CLASS TestShared
// error XS0182: An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type
METHOD DoTest(nShowState := DDD AS OBJECT) AS VOID
END CLASS

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions