-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linker error in algebraic.d / mir.format #63
Comments
seems like some issue auto-inferring |
How it is compiled? |
just for my linked code there I was using the code at libmir/mir-ion#22 |
WebFreak001
added a commit
to WebFreak001/mir-core
that referenced
this issue
Sep 27, 2022
Problem was that the user could pass in types that might not compile the same across all compilation units. This might be related to https://issues.dlang.org/show_bug.cgi?id=23154 but not sure. The `static if (__traits(compiles, { auto s = to!(immutable(char)[])(trustedGet!T);}))` was failing for me with ``` ../../.dub/packages/mir-core-1.3.6/mir-core/source/mir/algebraic.d(1510,58): Error: `pure` function `mir.algebraic.Algebraic!(Json_).Algebraic.toString!().toString` cannot call impure function `mir.conv.to!string.to!(const(Algebraic!(Json_)[])).to` ../../.dub/packages/mir-core-1.3.6/mir-core/source/mir/algebraic.d(1510,58): Error: `pure` function `mir.algebraic.Algebraic!(Json_).Algebraic.toString!().toString` cannot call impure function `mir.conv.to!string.to!(const(U!(Algebraic!(Json_)))).to` protocol/source/served/lsp/jsonops.d(50,11): Error: template instance `mir.algebraic.Algebraic!(Json_).Algebraic.toString!()` error instantiating ``` As templates already automatically infer their attributes, this shouldn't be a major breaking change. The `__traits(compiles)` rather looked like it would be inserted to check if the custom method can serialize to a string, not to check if it is pure doing so.
Please provide a link to the CI log that demonstrates this issue. |
9il
pushed a commit
that referenced
this issue
Oct 12, 2022
Problem was that the user could pass in types that might not compile the same across all compilation units. This might be related to https://issues.dlang.org/show_bug.cgi?id=23154 but not sure. The `static if (__traits(compiles, { auto s = to!(immutable(char)[])(trustedGet!T);}))` was failing for me with ``` ../../.dub/packages/mir-core-1.3.6/mir-core/source/mir/algebraic.d(1510,58): Error: `pure` function `mir.algebraic.Algebraic!(Json_).Algebraic.toString!().toString` cannot call impure function `mir.conv.to!string.to!(const(Algebraic!(Json_)[])).to` ../../.dub/packages/mir-core-1.3.6/mir-core/source/mir/algebraic.d(1510,58): Error: `pure` function `mir.algebraic.Algebraic!(Json_).Algebraic.toString!().toString` cannot call impure function `mir.conv.to!string.to!(const(U!(Algebraic!(Json_)))).to` protocol/source/served/lsp/jsonops.d(50,11): Error: template instance `mir.algebraic.Algebraic!(Json_).Algebraic.toString!()` error instantiating ``` As templates already automatically infer their attributes, this shouldn't be a major breaking change. The `__traits(compiles)` rather looked like it would be inserted to check if the custom method can serialize to a string, not to check if it is pure doing so.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
just encountered this, going to look into what I can do against this right now.
raw linker output:
ddemangle:
project + commit: https://github.com/Pure-D/serve-d/tree/a757a32e301fd6fa7be5bdbf8b727066cab5b9e0
The text was updated successfully, but these errors were encountered: