You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by martinkirch December 24, 2024
Using v2.3, I'm trying to implement a function able to check and update the given reference. A simplified version looks like:
next_track =ref({title="", artist="", rid=-1, initial_uri=""})
next_jingle =ref({title="", artist="", rid=-1, initial_uri=""})
def update_next_track(r)
if r().rid !=0then
r := {title="bla", artist="blo", rid=0, initial_uri="http://bla"}
end
end
update_next_track(next_track)
update_next_track(next_jingle)
but this results in a type error
line 6, char 4:
r := {title="bla", artist="blo", rid=0, initial_uri="http://bla"}
Error 5: this value has no method `set`
Its type is () -> 'A.{rid : int}.
I've tried to annotate the argument (r:ref or ref:ref({title:string, artist:string, rid:int, initial_uri:string})) but that raised a parse error.
The text was updated successfully, but these errors were encountered:
See: #4284
Originally posted by martinkirch December 24, 2024
Using v2.3, I'm trying to implement a function able to check and update the given reference. A simplified version looks like:
but this results in a type error
I've tried to annotate the argument (
r:ref
orref:ref({title:string, artist:string, rid:int, initial_uri:string})
) but that raised a parse error.The text was updated successfully, but these errors were encountered: