January 25, 2018 Explicit template instantiation in super call doesn't compile | ||||
---|---|---|---|---|
| ||||
The following example will not compile:
class Foo
{
this(T)(T a) {}
}
class C : Foo
{
this()
{
super!(int)(3);
}
}
The error is on the line of the super call:
"Error: found `!` when expecting `;` following statement"
Is this intentional or just an limitation in the grammar?
--
/Jacob Carlborg
|
January 25, 2018 Re: Explicit template instantiation in super call doesn't compile | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On 1/25/18 8:32 AM, Jacob Carlborg wrote:
> The following example will not compile:
>
> class Foo
> {
> this(T)(T a) {}
> }
>
> class C : Foo
> {
> this()
> {
> super!(int)(3);
> }
> }
>
> The error is on the line of the super call:
>
> "Error: found `!` when expecting `;` following statement"
>
> Is this intentional or just an limitation in the grammar?
I think maybe both?
I'll note that you can't even instantiate a Foo with an explicit constructor call.
-Steve
|
Copyright © 1999-2021 by the D Language Foundation