| Thread overview | |||||
|---|---|---|---|---|---|
|
July 30, 2013 Weird bug in IFTI | ||||
|---|---|---|---|---|
| ||||
http://dpaste.dzfl.pl/cdabf9fa But adding one more parameter gives an error! http://dpaste.dzfl.pl/a5cfac37 Template has no effect simply because I added an parameter with a default?!?!?!? | ||||
July 30, 2013 Re: Weird bug in IFTI | ||||
|---|---|---|---|---|
| ||||
Posted in reply to JS | On Tuesday, 30 July 2013 at 22:22:38 UTC, JS wrote: > But adding one more parameter gives an error! > > http://dpaste.dzfl.pl/a5cfac37 Copying the code for readability and for future generations: template SomeName(T...) { void SomeName(string file = __FILE__, string line = __LINE__, string f = __FUNCTION__)() { pragma(msg, f~";"); } } void main() { SomeName!("x"); } And the error: /d608/f685.d(8): Error: template SomeName(string file = __FILE__, string line = __LINE__, string f = __FUNCTION__)() has no effect > Template has no effect simply because I added an parameter with a default?!?!?!? You have a bug in there!!!!!!! __LINE__ is not a string!!?!!?! Make it `size_t line = __LINE__` and you're good....... The error message really doesn't help much, though. | |||
July 30, 2013 Re: Weird bug in IFTI | ||||
|---|---|---|---|---|
| ||||
Posted in reply to JS | On Tuesday, 30 July 2013 at 22:22:38 UTC, JS wrote:
> http://dpaste.dzfl.pl/cdabf9fa
>
> But adding one more parameter gives an error!
>
> http://dpaste.dzfl.pl/a5cfac37
>
> Template has no effect simply because I added an parameter with a default?!?!?!?
Definitely some compiler logic problems there with the error message at least.
What I'd like to see:
pragma(msg) should be immune from "has no effect" errors as it does have an observable effect at compile-time.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply