Bug 1010 – Abstract class template does not compile when parametrized with char[]

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-02-28T04:41:00Z
Last change time
2014-02-16T15:23:17Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
samukha

Comments

Comment #0 by samukha — 2007-02-28T04:41:57Z
abstract class Foo(char[] bar) { } int main(char[][] args) { return 0; } Fails to compile with the error message: hello.d:1: variable hello.bar abstract cannot be applied to variable :: === Build finished: 1 errors, 0 warnings === While this works: template Foo(char[] bar) { abstract class Foo { } } int main(char[][] args) { return 0; }
Comment #1 by thomas-dloop — 2007-03-08T10:29:49Z
Comment #2 by onlystupidspamhere — 2007-10-19T04:09:55Z
This also happens with int parameters and probably with other types too.
Comment #3 by gide — 2008-12-03T13:36:25Z
*** Bug 2236 has been marked as a duplicate of this bug. ***
Comment #4 by gide — 2009-04-23T04:05:52Z
Example and DStress test cases compile in D1.041. The DStress test cases fail in D2, because the template parameter is declared as a char[] rather than a string. C:\> dmd template_class_20_A.d template_class_20_A.d(17): template instance Foo!("abc") does not match template declaration Foo(char[] bar) template_class_20_A.d(17): Error: Foo!("abc") is used as a type template_class_20_A.d(17): class dstress.run.t.template_class_20_A.Bar base type must be class or interface, not void The following code compiles, should this bug be marked as a DStress issue? abstract class Foo(string bar) { } class Bar : Foo!("abc") { } int main(char[][] args) { return 0; }
Comment #5 by clugdbug — 2009-04-23T04:15:21Z
(In reply to comment #4) > Example and DStress test cases compile in D1.041. The DStress test cases fail > in D2, because the template parameter is declared as a char[] rather than a > string. > > C:\> dmd template_class_20_A.d > template_class_20_A.d(17): template instance Foo!("abc") does not match > template declaration Foo(char[] bar) > template_class_20_A.d(17): Error: Foo!("abc") is used as a type > template_class_20_A.d(17): class dstress.run.t.template_class_20_A.Bar base > type must be class or interface, not void > > > The following code compiles, should this bug be marked as a DStress issue? No. DStress was only developed for D1. It's never been ported to D2. You can safely close this bug.
Comment #6 by smjg — 2009-04-23T14:10:36Z
(In reply to comment #5) > No. DStress was only developed for D1. It's never been ported to D2. Moreover, if it had, it would certainly not have been completely changed into a D2 test suite, but have some built-in distinction between D1 and D2 testcases. But still, the testcases here and in DStress WFM (1.042 Win).