Skip to content

Spawn macro does not compose with logging macros #514

Closed

Description

@Octogonapus

Dagger v0.18.9, Julia v1.10.3

julia> Dagger.@spawn begin
           @debug "x"
       end
ERROR: LoadError: syntax: invalid syntax (escape (outerref @debug))
Stacktrace:
 [1] top-level scope
   @ REPL[4]:1
in expression starting at REPL[4]:2

Activity

  1. jpsamaroo commented on May 17, 2024

    @jpsamaroo
    Member

    Similar to #479 and #480, @spawn currently requires a function call as the top-level expression. This is for many reasons, most prominently because it makes it easily possible to track synchronization dependencies. We can and should implement a more capable parser, but it's not entirely trivial to implement, and can lead to some surprising behavior if users aren't careful.

  2. jpsamaroo commented on Oct 7, 2026

    @jpsamaroo
    Member

    Possible since #533 as:

    julia> Dagger.@spawn ()->begin
        @debug "x"
    end
    
    DTask (finished)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions