www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Possible regression in latest? dmd with inherited inner classes

reply Arafel <er.krali gmail.com> writes:
Hi,

I have found the following regression with the latest dmd:

https://run.dlang.io/is/4KdP5s


```
class A {
	class I { }
}

class B : A {
	C c;

	class II : I {
		void fun() {
			c = new C();
		}
	}
}

class C { }

void main() { }
```

When tried with the latest DMD it fails with

 onlineapp.d(10): Error: need this for c of type onlineapp.C
When I try "All dmd compilers" however I get
 All versions: Success and no output
So I can't pinpoint the exact version, although I assume it'd be the latest one. ldc and ldc-beta compile it without problems. I think this a bug because if I remove the inheritance of II : I, then it works without issue. A.
May 14 2019
next sibling parent Boris-Barboris <ismailsiege gmail.com> writes:
On Tuesday, 14 May 2019 at 15:35:15 UTC, Arafel wrote:
 Hi,

 I have found the following regression with the latest dmd:

 https://run.dlang.io/is/4KdP5s
Yep, got that thing blocking my upgrade as well. The issue apparently is quite old though. Here is a bug report: https://issues.dlang.org/show_bug.cgi?id=16215
May 14 2019
prev sibling parent Seb <seb wilzba.ch> writes:
On Tuesday, 14 May 2019 at 15:35:15 UTC, Arafel wrote:
 When I try "All dmd compilers" however I get

 All versions: Success and no output
Yeah we need to manually bump this, I just did so for you: https://github.com/dlang-tour/core-dreg/commit/b22c13446579ad127585de9edf93b4bda181e28e
May 14 2019