| Thread overview | |||||
|---|---|---|---|---|---|
|
January 03, 2009 final forbidden with value template parameters? | ||||
|---|---|---|---|---|
| ||||
Hi
module main;
class Foo(string s) {}
final class Bar(string s) {} // Error
The compiler says:
variable main.s final cannot be applied to variable
Why is this forbidden?
Nicolas
(DMD 2.022 - Linux)
| ||||
January 03, 2009 Re: final forbidden with value template parameters? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Nicolas Sicard | On Sat, Jan 3, 2009 at 1:26 PM, Nicolas Sicard <dransic@free.fr> wrote: > Hi > > module main; > class Foo(string s) {} > final class Bar(string s) {} // Error > > The compiler says: > variable main.s final cannot be applied to variable > > Why is this forbidden? > > Nicolas > (DMD 2.022 - Linux) > It might be related to this: http://d.puremagic.com/issues/show_bug.cgi?id=1481 But without a full example - where you're instantiating the template - I can't say for sure. | |||
January 03, 2009 Re: final forbidden with value template parameters? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | On Sat, 03 Jan 2009 21:39:35 +0300, Jarrett Billingsley <jarrett.billingsley@gmail.com> wrote: > On Sat, Jan 3, 2009 at 1:26 PM, Nicolas Sicard <dransic@free.fr> wrote: >> Hi >> >> module main; >> class Foo(string s) {} >> final class Bar(string s) {} // Error >> >> The compiler says: >> variable main.s final cannot be applied to variable >> >> Why is this forbidden? >> >> Nicolas >> (DMD 2.022 - Linux) >> > > It might be related to this: > > http://d.puremagic.com/issues/show_bug.cgi?id=1481 > > But without a full example - where you're instantiating the template - > I can't say for sure. That's full example. No need to instantiate this template to get an error. It is a bug and I was hit by this multiple times already :( | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply