Lambdas Scope

Salih Dincer salihdb at hotmail.com
Mon Apr 11 09:11:06 UTC 2022


How is this possible? Why is it compiled? Don't the same names in 
the same scope conflict?

```d
int function(int) square;
void main()
{
   square = (int a) => a * a;
   int square = 5.square;
   assert(square == 25);
}
```

Thanks, SDB at 79


More information about the Digitalmars-d-learn mailing list