[Issue 8408] Purity calculation should be improved

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 10 18:31:19 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8408



--- Comment #9 from bearophile_hugs at eml.cc 2012-12-10 18:31:16 PST ---
(In reply to comment #8)

> I'm not sure that this should be allowed.
> foo1 can rewrite the elements referred from arr, then it is deduced to weak
> purity. In current principle, the returned value from weak purity function
> cannot be converted to immutable implicitly (it is only allowed for strong
> purity function).
> 
> If you change the signature of foo1 to:
> 
>   char[] foo1(const int[] arr) pure;
> 
> Then foo1 will be deduced to strong purity, and implicit conversion to
> immutable for initializing x1 will be succeeded.

You are right, thank you for your answer.

(If you want me/us to try to suggest improvements in how you write in English,
I am willing to help you, despite I am not a good English teacher.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list