I was trying to declare a static variable dependent on another
static variable, but it didn't work. Are static variables not
known to other static variables at compile time?
void main()
{
C c = new C();
}
class C
{
static size_t A = 2;
static size_t B = 2^^A; // A is not
On Friday, 12 April 2019 at 10:49:19 UTC, Jamie wrote:
I was trying to declare a static variable dependent on another
static variable, but it didn't work. Are static variables not
known to other static variables at compile time?
void main()
{
C c = new C();
}
class C
{
stat
On Friday, 12 April 2019 at 10:49:19 UTC, Jamie wrote:
I was trying to declare a static variable dependent on another
static variable, but it didn't work. Are static variables not
known to other static variables at compile time?
Add `const` or `immutable` to A and it will work.
I don't know wh
On Friday, 12 April 2019 at 10:56:32 UTC, Jamie wrote:
On Friday, 12 April 2019 at 10:49:19 UTC, Jamie wrote:
I was trying to declare a static variable dependent on another
static variable, but it didn't work. Are static variables not
known to other static variables at compile time?
void main
On Friday, 12 April 2019 at 10:56:32 UTC, Jamie wrote:
On Friday, 12 April 2019 at 10:49:19 UTC, Jamie wrote:
I was trying to declare a static variable dependent on another
static variable, but it didn't work. Are static variables not
known to other static variables at compile time?
void main
On Friday, 12 April 2019 at 10:56:32 UTC, Jamie wrote:
On Friday, 12 April 2019 at 10:49:19 UTC, Jamie wrote:
I was trying to declare a static variable dependent on another
static variable, but it didn't work. Are static variables not
known to other static variables at compile time?
void main