Conversation
| import dsfml.system.string; | ||
| sfWindow_createFromHandle(sfPtr, handle, settings.depthBits,settings.stencilBits, settings.antialiasingLevel, settings.majorVersion, settings.minorVersion); | ||
| err.write(toString(sfErr_getOutput())); | ||
| err.write(dsfml.system.string.toString(sfErr_getOutput())); |
There was a problem hiding this comment.
Why do you need import dsfml.system.string?
There was a problem hiding this comment.
So that I don't have to import anything from the standard library.
dsfml.system.string.toString is specific to C strings and its only job is to convert them to a D styled string.
edit:
You still need to import the module. I only explicitly wrote dsfml.system.string.toString because otherwise it uses Object.toString which is what broke the code previously.
There was a problem hiding this comment.
Have you tried to import dsfml.system.string : toString? Or do need something else from that module?
There was a problem hiding this comment.
That wouldn't help. Based on the new rules, the compiler will attempt to look up symbols locally before checking imported modules, even modules that are imported in the same scope. It will always find Object.toString first, so we have to be explicit.
Does import module : symbol only import the one symbol now? I was under the assumption that it still imported the whole module.
There was a problem hiding this comment.
Does
import module : symbolonly import the one symbol now? I was under the assumption that it still imported the whole module.
I was under impression that it always imported only the selected symbols.
There was a problem hiding this comment.
You still need to import the module. I only explicitly wrote
dsfml.system.string.toStringbecause otherwise it uses Object.toString which is what broke the code previously.It will always find Object.toString first
I'm trying to construct the smallest possible code to reproduce this. But it works either way. Though, I don't use extern(C).
There was a problem hiding this comment.
I was under impression that it always imported only the selected symbols.
As I understand it, the compiler lets you use only those symbols as part of the import system, but it does actually import the entire module.
This let's you use the most recent compiler for DSFML.
Fixes #219