Circular-Studios / Spectral-Robot

Spectral Robot Task Force
http://circularstudios.com
Other
8 stars 0 forks source link

Error: variable n cannot be read at compile time #38

Closed PxlBuzzard closed 10 years ago

PxlBuzzard commented 10 years ago

The full error in grid.d is below. The relevant lines are 13, 118, and 136. The error started when I made tiles not static in order to instantiate them at runtime via yaml.

Scripts\grid.d(118): Error: variable n cannot be read at compile time

I've tried adding shared to tiles as well as appending to a not-instantiated array with no success. @msoucy was equally confused.

@ColdenCullen @zeDoctor

PxlBuzzard commented 10 years ago

Fixed! Turns out 'new' declarations are silly in D. Thank you to Stack Overflow.

_tiles = new shared Tile[][]( n, m );