chuck
chuck copied to clipboard
Order of class definitions in a file matters sometimes
As described in the comment here
Sample.ck, line 25 https://github.com/heuermh/lick/blob/master/Sample.ck#L25
if the order of class definitions in that file are rearranged such that Sample comes before the other classes (SampleProcedure, SampleIntProcedure, etc.) then the ChucK compiler reports an error
$ chuck --loop &
$ chuck + import.ck
...
[Sample.ck]:line(72): function 'asProcedure@0@Sample' was defined
with return type 'Procedure' -- but returning type 'SampleProcedure'
[Sample.ck]: ...in function 'asProcedure'
Generally the order of class definitions in a file should not matter.