digitalmars.D.learn - Access specifiers and visibility
- Andrew Edwards (43/43) May 09 2017 Attempting to update a git repo to current D, I encounter the
- Jesse Phillips (5/12) May 10 2017 This comes from:
- Andrew Edwards (6/20) May 10 2017 I actually attempted solve the issue with selective import as
- Jesse Phillips (10/33) May 10 2017 I'm not sure the library you're using but this like the one:
- Andrew Edwards (8/45) May 12 2017 That's not the same library but the exact same implementation.
- John Colvin (7/21) May 13 2017 Those error messages are often misleading. The name of the symbol
Attempting to update a git repo to current D, I encounter the following deprecation messages: src/glwtf/signals.d-mixin-256(256,2): Deprecation: glwtf.input.BaseGLFWEventHandler._on_key_down is not visible from module glwtf.signals src/glwtf/signals.d-mixin-256(256,2): Deprecation: glwtf.input.BaseGLFWEventHandler._on_key_up is not visible from module glwtf.signals src/glwtf/signals.d-mixin-256(256,2): Deprecation: glwtf.input.BaseGLFWEventHandler._on_mouse_button_down is not visible from module glwtf.signals src/glwtf/signals.d-mixin-256(256,2): Deprecation: glwtf.input.BaseGLFWEventHandler._on_mouse_button_up is not visible from module glwtf.signals The offending line of code in signal.d for all four messages is: _impl.addSlot(obj, cast(void delegate())mixin("&obj."~method)); these methods are implemented in the following default constructor: class BaseGLFWEventHandler : AEventHandler { // [...] this() { on_key_down.connect!"_on_key_down"(this); on_key_up.connect!"_on_key_up"(this); on_mouse_button_down.connect!"_on_mouse_button_down"(this); on_mouse_button_up.connect!"_on_mouse_button_up"(this); } // [...] } Which are implemented in the following abstract class: abstract class AEventHandler { // input Signal!(int, int, int) on_key_down; Signal!(int, int, int) on_key_up; Signal!(int, int) on_mouse_button_down; Signal!(int, int) on_mouse_button_up; } I'm not sure how to address this issue so am seeking guidance on how to update this code such that it complies with current D. Thanks, Andrew
May 09 2017
On Wednesday, 10 May 2017 at 01:42:47 UTC, Andrew Edwards wrote:Attempting to update a git repo to current D, I encounter the following deprecation messages: src/glwtf/signals.d-mixin-256(256,2): Deprecation: glwtf.input.BaseGLFWEventHandler._on_key_down is not visible from module glwtf.signals Thanks, AndrewThis comes from: http://dlang.org/changelog/2.071.0.html#dip22 The module glwtf.signals needs to import glwtf.input. One of the other imports was contaminating the namespace.
May 10 2017
On Wednesday, 10 May 2017 at 13:13:46 UTC, Jesse Phillips wrote:On Wednesday, 10 May 2017 at 01:42:47 UTC, Andrew Edwards wrote:I actually attempted solve the issue with selective import as such:: import glwtf.input : BaseGLFWEventHandler; but it did not work. Importing the entire module does not work either.Attempting to update a git repo to current D, I encounter the following deprecation messages: src/glwtf/signals.d-mixin-256(256,2): Deprecation: glwtf.input.BaseGLFWEventHandler._on_key_down is not visible from module glwtf.signals Thanks, AndrewThis comes from: http://dlang.org/changelog/2.071.0.html#dip22 The module glwtf.signals needs to import glwtf.input. One of the other imports was contaminating the namespace.
May 10 2017
On Wednesday, 10 May 2017 at 13:29:40 UTC, Andrew Edwards wrote:On Wednesday, 10 May 2017 at 13:13:46 UTC, Jesse Phillips wrote:I'm not sure the library you're using but this like the one: https://github.com/Dav1dde/glwtf/blob/master/glwtf/input.d#L163 This code says that the function is protected. https://github.com/Dav1dde/glwtf/blob/master/glwtf/signals.d#L254 This line is probably mixing in a call to that function into a struct https://github.com/Dav1dde/glwtf/blob/master/glwtf/signals.d#L229 But that struct doesn't inherit from the class so it can't access protected fields.On Wednesday, 10 May 2017 at 01:42:47 UTC, Andrew Edwards wrote:I actually attempted solve the issue with selective import as such:: import glwtf.input : BaseGLFWEventHandler; but it did not work. Importing the entire module does not work either.Attempting to update a git repo to current D, I encounter the following deprecation messages: src/glwtf/signals.d-mixin-256(256,2): Deprecation: glwtf.input.BaseGLFWEventHandler._on_key_down is not visible from module glwtf.signals Thanks, AndrewThis comes from: http://dlang.org/changelog/2.071.0.html#dip22 The module glwtf.signals needs to import glwtf.input. One of the other imports was contaminating the namespace.
May 10 2017
On Thursday, 11 May 2017 at 04:35:22 UTC, Jesse Phillips wrote:On Wednesday, 10 May 2017 at 13:29:40 UTC, Andrew Edwards wrote:That's not the same library but the exact same implementation. The one I'm using (https://github.com/d-gamedev-team/dimgui) borrows its from the deimos bindings. So since the a struct cannot inherit from a class and vice versa, then the entire approach taken by the library must be reconsidered going forward. A little over my head at this point. Thanks for the assist.On Wednesday, 10 May 2017 at 13:13:46 UTC, Jesse Phillips wrote:I'm not sure the library you're using but this like the one: https://github.com/Dav1dde/glwtf/blob/master/glwtf/input.d#L163 This code says that the function is protected. https://github.com/Dav1dde/glwtf/blob/master/glwtf/signals.d#L254 This line is probably mixing in a call to that function into a struct https://github.com/Dav1dde/glwtf/blob/master/glwtf/signals.d#L229 But that struct doesn't inherit from the class so it can't access protected fields.On Wednesday, 10 May 2017 at 01:42:47 UTC, Andrew Edwards wrote:I actually attempted solve the issue with selective import as such:: import glwtf.input : BaseGLFWEventHandler; but it did not work. Importing the entire module does not work either.Attempting to update a git repo to current D, I encounter the following deprecation messages: src/glwtf/signals.d-mixin-256(256,2): Deprecation: glwtf.input.BaseGLFWEventHandler._on_key_down is not visible from module glwtf.signals Thanks, AndrewThis comes from: http://dlang.org/changelog/2.071.0.html#dip22 The module glwtf.signals needs to import glwtf.input. One of the other imports was contaminating the namespace.
May 12 2017
On Wednesday, 10 May 2017 at 01:42:47 UTC, Andrew Edwards wrote:Attempting to update a git repo to current D, I encounter the following deprecation messages: src/glwtf/signals.d-mixin-256(256,2): Deprecation: glwtf.input.BaseGLFWEventHandler._on_key_down is not visible from module glwtf.signals src/glwtf/signals.d-mixin-256(256,2): Deprecation: glwtf.input.BaseGLFWEventHandler._on_key_up is not visible from module glwtf.signals src/glwtf/signals.d-mixin-256(256,2): Deprecation: glwtf.input.BaseGLFWEventHandler._on_mouse_button_down is not visible from module glwtf.signals src/glwtf/signals.d-mixin-256(256,2): Deprecation: glwtf.input.BaseGLFWEventHandler._on_mouse_button_up is not visible from module glwtf.signalsThose error messages are often misleading. The name of the symbol alone is (often, always?) right but the module/package it says it's from is often nonsense. I often get deprecation messages saying things like "myPackage.myModule.to is not visible from module myPackage.myOtherModule", when the real problem is I forgot to import std.conv in myPackage.myOtherModule.
May 13 2017