Bug 9891 – Ability to modify immutable using default value of ref/out parameter

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-04-06T09:24:00Z
Last change time
2015-09-09T10:29:11Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2013-04-06T09:24:13Z
The following code compiles but should not: --- immutable int i; void f(ref int n = i) { ++n; } --- P.S. Inspired by fixed Issue 9773.
Comment #1 by hsteoh — 2014-10-02T18:42:31Z
Still happens on git HEAD (b7ace0b93bb1...).
Comment #2 by k.hara.pg — 2015-09-08T06:52:09Z
Comment #3 by github-bugzilla — 2015-09-09T10:29:10Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6b091dc67a71b82a30ba26d2af73e2d67180740c fix Issue 9891 - Ability to modify immutable using default value of ref/out parameter https://github.com/D-Programming-Language/dmd/commit/065881c6f71ef8e76c882b2ce739fa452b547e8e Merge pull request #5056 from 9rnsr/fix9891 Issue 9891 - Ability to modify immutable using default value of ref/out parameter