May 11, 2008 Template type parameter turns to int | ||||
|---|---|---|---|---|
| ||||
Given program (dmd 2.013):
void foo(T)() {
pragma(msg, T.stringof);
}
void main() {
foo!(bar)();
}
I would expect the compiler to report an error about the unknown identifier, bar. Instead the program is accepted and the compiler prints "int". Is this a bug or is there a way to make it give an error?
| ||||
May 11, 2008 Re: Template type parameter turns to int | ||||
|---|---|---|---|---|
| ||||
Posted in reply to mpt | mpt wrote: > Given program (dmd 2.013): > > void foo(T)() { > pragma(msg, T.stringof); > } > > void main() { > foo!(bar)(); > } > > I would expect the compiler to report an error about the unknown identifier, bar. Instead the program is accepted and the compiler prints "int". Is this a bug or is there a way to make it give an error? That looks like a bug. (1.029 reports an error, so it's only in the D2 branch) Please report it at http://d.puremagic.com/issues/ | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply