Skip to content

Naming inconsistency between member.nameof and parameter.name #3083

@Ecoral360

Description

@Ecoral360

I know this is a nit pick and it's ok if stays as is, I just want to point it out because I thought about it and it is a small inconsistency

The field to get the name of a type and the name of a member is nameof

struct Baz
{
    int x;
    Foo* z;
}
String x = Baz.membersof[1].nameof; // "z"
String i = int.nameof; // "int"

But the field to get the name of a parameter is name

alias TestFunc = fn int(int x, double f);
String s = TestFunc.paramsof[1].name; // "f"

Imo, they should share the same name (nameof) because they represent the same concept and the same operation.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions