Page MenuHomeFeedback Tracker

Enscript parameter shadowing (bug?)
Closed, ResolvedPublic

Description

void fn(out int a) {
  a = 2;
  int a; // shadows/hides parameter 'a', no error, from this point on, you cannot access the out parameter.
  a = 4;
}
void Test() {
  int res;
  fn(res);
  Print(res); // 2
}
void fn(int a) {
  a = 2;
  int a; // error, multi decl of 'a'
  a = 4;
}

Is this intended?

Details

Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General

Event Timeline

Geez changed the task status from New to Assigned.Oct 16 2022, 11:12 PM
Geez closed this task as Resolved.Jun 12 2023, 11:11 AM
Geez claimed this task.
Geez added a subscriber: Geez.

Resolved for one of the future updates.