chuck icon indicating copy to clipboard operation
chuck copied to clipboard

Order of class definitions in a file matters sometimes

Open heuermh opened this issue 11 years ago • 0 comments

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.

heuermh avatar Jan 03 '14 18:01 heuermh