On Friday, 27 May 2022 at 08:39:08 UTC, vit wrote:
Hello, I have this problem:

```d
static int i;

void bar(T)(){
        static if(is(T == int))
        (()@system => 1)();
    static if(is(T == float))
        i = 42;

}
void foo(T)(){
        bar!T();
}

void main()@safe pure{
        foo!long();
foo!float(); //Error: `pure` function `D main` cannot call impure function `onlineapp.foo!float.foo` foo!int(); //Error: `@safe` function `D main` cannot call `@system` function `onlineapp.foo!int.foo`
}
```

[...]

on a side note that's funny how dmd manages to systematically print the less interesting message in both case.

Reply via email to