/c1906e09d7b773bc5ff0a2477b3139c98d8e60ea
fix Issue 7554 - Immutable function pointer arguments too
Protect function type from inappropriate modifier transition.
https://github.com/D-Programming-Language/dmd/commit/461649be7975faf119188674f296a7fac7c38a96
Merge pull request #772 from 9rnsr/fix7554
Issue 7554 - Immutable function
http://d.puremagic.com/issues/show_bug.cgi?id=7554
Walter Bright bugzi...@digitalmars.com changed:
What|Removed |Added
Status|NEW |RESOLVED
http://d.puremagic.com/issues/show_bug.cgi?id=7554
--- Comment #3 from bearophile_h...@eml.cc 2012-02-27 15:27:55 PST ---
This code compiles, but I don't remember if this used to compile even before
fixing bug 7500 :
int outer(immutable int function(in int) pure foo) pure {
pure int
http://d.puremagic.com/issues/show_bug.cgi?id=7554
--- Comment #4 from Kenji Hara k.hara...@gmail.com 2012-02-27 17:10:21 PST ---
OK. Reduced test case.
int sqr(int x) pure {
return x * x;
}
void main()
{
immutable(int function(int) pure) ifp = sqr;
// Error: cannot implicitly
http://d.puremagic.com/issues/show_bug.cgi?id=7554
Kenji Hara k.hara...@gmail.com changed:
What|Removed |Added
Keywords||pull
--- Comment #5
http://d.puremagic.com/issues/show_bug.cgi?id=7554
--- Comment #1 from Kenji Hara k.hara...@gmail.com 2012-02-26 08:23:38 PST ---
I think making inner() pure isn't necessary.
Following raises no error and works as expected.
T outer(T)(T function(in T) pure foo) pure {
int inner() {
http://d.puremagic.com/issues/show_bug.cgi?id=7554
--- Comment #2 from bearophile_h...@eml.cc 2012-02-26 10:58:27 PST ---
(In reply to comment #1)
I think making inner() pure isn't necessary.
In this program I want inner() to be pure.
--
Configure issuemail: