Skip to content

workaroundable error: dependency loop detected  #21884

Description

@xBZZZZ

Zig Version

0.14.0-dev.2097+d30e28754

Steps to Reproduce and Observed Behavior

  1. create file a.zig with content:
    const myfunctype=*const fn(arg: mystruct) callconv(.C) void;
    
    const mystruct=extern struct{
    	func_addr:myfunctype
    };
    
    //export fn workaround(x: mystruct) callconv(.C) void{
    //_=x;
    //}
    
    comptime{
    	_=myfunctype;
    }
  2. run
    zig build-obj a.zig
a.zig:1:1: error: dependency loop detected
const myfunctype=*const fn(arg: mystruct) callconv(.C) void;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
    mystruct: a.zig:3:23
    myfunctype: a.zig:1:33
    5 reference(s) hidden; use '-freference-trace=7' to see all references

Expected Behavior

a.o file successfully created

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions