liquidsoap
liquidsoap copied to clipboard
Typing error on cross handler.
This example
#!../../src/liquidsoap -i ../../libs/stdlib.liq ../../libs/deprecations.liq
s = amplify(0.5, sequence([sine(duration=5.), sine(500.)]))
jingle = playlist("files/jingles")
# The subtlety here is that once(jingle) returns a source with methods (such as
# id). The inference thus thinks that a.source has methods. And the function f
# thus cannot be passed to cross because it is not general enough.
def f(a, b)
sequence([a.source, once(jingle), b.source])
end
s = cross(f, s)
output.dummy(s)
def on_done () =
test.pass()
shutdown()
end
thread.run(delay=8., on_done)
exhibits a subtle typing error as indicated in the comment: f
takes an a
with a method
source which is uselessly required to have an id
field because of the presence of once
and unification. Not really sure about how to get out of this one for now...
Minimized version (which does not require standard library):
s = sine()
j = sine()
def once((s:source))
sine()
end
def f(a)
ignore([a, once(j)])
end
def cross((f : (source) -> unit), s)
s
end
s = cross(f, s)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.