Skip to content

Failed to use source built-in methods after calling method that uses source #1833

Answered by toots
vitoyucepi asked this question in Q&A
Discussion options

You must be logged in to vote

That's definitely another type inference issue here. Let me try to explain.

Since 2.0.0, sources have methods, so here's a typical type for a source:

# s = single("/tmp/bla.mp3");;
s :
  source(audio=?A, video=?B, midi=?C)
  .{
    time : () -> float,
    shutdown : () -> unit,
    fallible : bool,
    skip : () -> unit,
    seek : (float) -> float,
    is_active : () -> bool,
    is_up : () -> bool,
    log :
    {level : (() -> int?).{set : ((int) -> unit)}
    },
    self_sync : () -> bool,
    duration : () -> float,
    elapsed : () -> float,
    remaining : () -> float,
    on_track : ((([string * string]) -> unit)) -> unit,
    on_leave : ((() -> unit)) -> unit,
    on_shutdown : (…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by toots
Comment options

vitoyucepi
Aug 17, 2021
Collaborator Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1827 on August 18, 2021 13:16.