Jump to page: 1 24  
Page
Thread overview
[Issue 13084] ModuleInfo.opApply delegate expects immutable parameter
Jul 10, 2014
Kenji Hara
Jul 10, 2014
Jacob Carlborg
Jul 11, 2014
Kenji Hara
Jul 12, 2014
Walter Bright
Jul 12, 2014
Jacob Carlborg
Jul 12, 2014
Jacob Carlborg
Jul 12, 2014
Walter Bright
Jul 12, 2014
Jacob Carlborg
Jul 13, 2014
Walter Bright
Jul 13, 2014
Walter Bright
Jul 13, 2014
Kenji Hara
Jul 13, 2014
Walter Bright
Jul 13, 2014
Kenji Hara
Jul 13, 2014
Jacob Carlborg
Jul 13, 2014
Walter Bright
Jul 13, 2014
Jacob Carlborg
Jul 13, 2014
Walter Bright
Jul 13, 2014
Jacob Carlborg
Jul 14, 2014
David Nadlinger
Jul 14, 2014
Jacob Carlborg
Jul 17, 2014
Kenji Hara
Jul 17, 2014
David Nadlinger
Jul 17, 2014
Dicebot
Jul 18, 2014
Kenji Hara
Jul 18, 2014
Walter Bright
Jul 18, 2014
Dicebot
Jul 18, 2014
Jacob Carlborg
Jul 19, 2014
Walter Bright
Jul 19, 2014
Dicebot
Jul 21, 2014
Martin Nowak
Jul 25, 2014
Jacob Carlborg
July 10, 2014
https://issues.dlang.org/show_bug.cgi?id=13084

--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> ---
It is intentional to change all ModuleInfo objects immutable.

https://github.com/D-Programming-Language/druntime/pull/790

--
July 10, 2014
https://issues.dlang.org/show_bug.cgi?id=13084

--- Comment #2 from Jacob Carlborg <doob@me.com> ---
I assumed that, but i still breaks code. What about the standard deprecation cycle?

--
July 11, 2014
https://issues.dlang.org/show_bug.cgi?id=13084

--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> ---
(In reply to Jacob Carlborg from comment #2)
> I assumed that, but i still breaks code. What about the standard deprecation cycle?

Unfortunately, it's impossible. We cannot allow iterating both mutable and immutable objects by ModuleInfo.opApply, because it will cause type system violation. We should change the opApply signature all at once.

And compiler already place all ModuleInfo in read-only section. So modifying ModuleInfo will cause segfault in some platforms. It's more worse.

--
July 12, 2014
https://issues.dlang.org/show_bug.cgi?id=13084

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> ---
Hmm. Suppose we did this:

  alias immutable(_ModuleInfo) ModuleInfo;

?

--
July 12, 2014
https://issues.dlang.org/show_bug.cgi?id=13084

--- Comment #5 from Jacob Carlborg <doob@me.com> ---
(In reply to Walter Bright from comment #4)
> Hmm. Suppose we did this:
> 
>   alias immutable(_ModuleInfo) ModuleInfo;
> 
> ?

It would still break the API.

--
July 12, 2014
https://issues.dlang.org/show_bug.cgi?id=13084

--- Comment #6 from Jacob Carlborg <doob@me.com> ---
(In reply to Kenji Hara from comment #3)

> And compiler already place all ModuleInfo in read-only section. So modifying ModuleInfo will cause segfault in some platforms. It's more worse.

How can you modify ModuleInfo when all its members (methods and fields) are
const?

--
July 12, 2014
https://issues.dlang.org/show_bug.cgi?id=13084

--- Comment #7 from Walter Bright <bugzilla@digitalmars.com> ---
(In reply to Jacob Carlborg from comment #5)
> (In reply to Walter Bright from comment #4)
> > Hmm. Suppose we did this:
> > 
> >   alias immutable(_ModuleInfo) ModuleInfo;
> > 
> > ?
> 
> It would still break the API.

How? (I know it will break people modifying ModuleInfo at runtime, but anything
else?)

--
July 12, 2014
https://issues.dlang.org/show_bug.cgi?id=13084

--- Comment #8 from Jacob Carlborg <doob@me.com> ---
(In reply to Walter Bright from comment #7)

> How? (I know it will break people modifying ModuleInfo at runtime, but
> anything else?)

If I understand you correctly the current ModuleInfo would be renamed to _ModuleInfo and a new immutable alias would be added, named ModuleInfo?

The ModuleInfo I have declared would be immutable? That could work. I will work for the function where I found the problem but it returns the module info and I have not looked yet how the returned value is used.

--
July 13, 2014
https://issues.dlang.org/show_bug.cgi?id=13084

--- Comment #9 from Walter Bright <bugzilla@digitalmars.com> ---
(In reply to Jacob Carlborg from comment #8)
> If I understand you correctly the current ModuleInfo would be renamed to _ModuleInfo and a new immutable alias would be added, named ModuleInfo?

Yes.

> The ModuleInfo I have declared would be immutable?

Yes.

> That could work. I will
> work for the function where I found the problem but it returns the module
> info and I have not looked yet how the returned value is used.

--
July 13, 2014
https://issues.dlang.org/show_bug.cgi?id=13084

--- Comment #10 from Walter Bright <bugzilla@digitalmars.com> ---
Did the alias thang:

https://github.com/D-Programming-Language/druntime/pull/886 https://github.com/D-Programming-Language/dmd/pull/3754

--
« First   ‹ Prev
1 2 3 4