[Issue 15462] Incorrect error message depending on import order + missing LoC information on generated ctor error

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Apr 29 03:29:15 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=15462

Mathias Lang <mathias.lang at sociomantic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mathias.lang at sociomantic.co
                   |                            |m
            Summary|undefined indentifiers that |Incorrect error message
                   |should be visible           |depending on import order +
                   |                            |missing LoC information on
                   |                            |generated ctor error

--- Comment #1 from Mathias Lang <mathias.lang at sociomantic.com> ---
Do you know which version are affected ?
It isn't a 2.071 regression, 2.070 exhibit the same behaviour.
It seems to be a bad diagnostic but since reordering the code to the following:

```
import core.thread;
class CoreTask : TaskFiber {}
class TaskFiber : Fiber {}
```

(Note how the import moved to the top)
gives an (almost) proper error message (LoC information is missing):

```
Error: constructor core.thread.Fiber.this is not accessible from module lol
```

Indeed the generated default ctor is trying to call the base class default
ctor, which is private:
https://github.com/dlang/druntime/blob/62e43c5f1ed9fc4491cd89ebca08c9dda2c0abe5/src/core/thread.d#L4263-L4270

Edited the issue title accordingly.

--


More information about the Digitalmars-d-bugs mailing list