Skip to content

init for imported module is called before the init of it's imports #1238

@levovix0

Description

@levovix0

super.nim

import std/syncio
import sub
echo "super"

sub.nim

import std/syncio
import b, a
echo "sub"

b.nim

import std/syncio
echo "b"

a.nim

import std/syncio
echo "a"

will print

sub
b
a
super

should be b, a, sub, super instead.

order of init execution seems to be dependent on order of linking .o files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CompatCould be adapted to compatibility mode

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions