ccrma / chuck

ChucK Music Programming Language
http://chuck.stanford.edu/
GNU General Public License v2.0
803 stars 128 forks source link

unrecognized class parent when used before decl #375

Closed gewang closed 11 months ago

gewang commented 11 months ago

example, e => now; causes this error:

iss-type-scan.ck:8:3: error: cannot resolve operator '=>' on types 'TheEvent' and 'time'
[8] e => now;
      ^

in this program:

// instance of our event
TheEvent e;

// issue: e is not yet known as child of Event
e => now;

// custom Event class
class TheEvent extends Event { }

cause: the parent of TheEvent is processed in type check pass 3 after e => now; possible remedy: refactor the parent info to be set in pass 2

gewang commented 11 months ago

fixed in 4a17fb6