|--- |FIXED
--- Comment #10 from Dlang Bot ---
dlang/dmd pull request #16594 "Fix Bugzilla 12885 - const union wrongly
converts implicitly to mutable" was merged into master:
- 7531b1ae708a478900984734aec044d4dd38379c by Nick Treleaven:
Fix Bugzilla 12885 - const union wrongl
created dlang/dmd pull request #16594 "Fix Bugzilla 12885 - const union
wrongly converts implicitly to mutable" fixing this issue:
- Fix Bugzilla 12885 - const union wrongly converts implicitly to mutable
https://github.com/dlang/dmd/pull/16594
--
https://issues.dlang.org/show_bug.cgi?id=21856
--- Comment #4 from Nick Treleaven ---
(In reply to RazvanN from comment #2)
> The safest and most restrictive solution would be to simply allow the
> conversion only if the function is strongly pure, thus disallowing the
> latter case, however,
@safe violation of |Mutable base object
|immutable |returned as immutable from
||weakly pure function
--
https://issues.dlang.org/show_bug.cgi?id=10376
Nick Treleaven changed:
What|Removed |Added
CC||john.loughran.colvin@gmail.
https://issues.dlang.org/show_bug.cgi?id=10376
Nick Treleaven changed:
What|Removed |Added
See Also||https://issues.dlang.org/sh
https://issues.dlang.org/show_bug.cgi?id=2947
Nick Treleaven changed:
What|Removed |Added
CC||n...@geany.org
See Also|
updated dlang/dmd pull request #16347 "Require @system for field
initializers with mutable reference types" fixing this issue:
- Require @system for field initializers with mutable reference types
Enabled with -preview=unsafeFieldInit.
Fixes Bugzilla 10376 - Mutable field i
||n...@geany.org
Summary|Glaring hole in const |Mutable field initializer
|system |reference is accessible
||through immutable aggregate
--
as string |argument can be returned as
||string, mislabeling mutable
||data as immutable
--
|--- |FIXED
--- Comment #2 from Dlang Bot ---
dlang/phobos pull request #8917 "fix Bugzilla Issue 24403 - Nullable doesn't
work with non-mutable types with a destructor" was merged into master:
- 4d9ca315b7cb1925ebf620a8f30f8bf7b47390c4 by Jonathan M Davis:
fix Bugzilla I
---
@jmdavis created dlang/phobos pull request #8917 "fix Bugzilla Issue 24403 -
Nullable doesn't work with non-mutable types with a destructor" fixing this
issue:
- fix Bugzilla Issue 24403 - Nullable doesn't work with non-mutable types with
a destructor
This should make it so that a variab
https://issues.dlang.org/show_bug.cgi?id=24403
Issue ID: 24403
Summary: Nullable doesn't work with non-mutable types with a
destructor
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
https://issues.dlang.org/show_bug.cgi?id=24394
Nick Treleaven changed:
What|Removed |Added
Keywords||safe
CC|
On Wednesday, 14 February 2024 at 11:56:29 UTC, Forest wrote:
On Wednesday, 14 February 2024 at 10:57:42 UTC, RazvanN wrote:
This has already been fixed, you just need to use
-preview=fixImmutableConv. This was put behind a preview flag
as it introduces a breaking change.
I just tried that
On Wednesday, 14 February 2024 at 10:57:42 UTC, RazvanN wrote:
This has already been fixed, you just need to use
-preview=fixImmutableConv. This was put behind a preview flag
as it introduces a breaking change.
I just tried that flag on run.dlang.org, and although it fixes
the case I
https://issues.dlang.org/show_bug.cgi?id=24394
--- Comment #2 from Forest ---
The above example does indeed trigger an error with -preview=fixImmutableConv
on run.dlang.org. However, changing the test function's argument to
const(ubyte)[] slips right past with no complaint.
Shouldn't that be
https://issues.dlang.org/show_bug.cgi?id=24394
RazvanN changed:
What|Removed |Added
Status|NEW |RESOLVED
CC|
On Tuesday, 13 February 2024 at 14:05:03 UTC, Johan wrote:
On Tuesday, 13 February 2024 at 08:10:20 UTC, Jonathan M Davis
wrote:
So, there's definitely a bug here, but it's a dmd bug. Its
checks for whether it can safely change the constness of the
return type apparently aren't sophisticated
https://issues.dlang.org/show_bug.cgi?id=24394
Issue ID: 24394
Summary: mutable array can be returned as string
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: normal
On Tuesday, 13 February 2024 at 08:10:20 UTC, Jonathan M Davis
wrote:
So, there's definitely a bug here, but it's a dmd bug. Its
checks for whether it can safely change the constness of the
return type apparently aren't sophisticated enough to catch
this case.
This is a pretty severe bug.
able uint) != -1)
> ```
>
> Shouldn't that precondition's `immutable T` be simply `T`?
>
> As it stands, I can do this with no complaints from the
> compiler...
>
> ```d
> string test(ubyte[] arr)
> {
> import std.string;
> return arr.assumeUTF;
> }
>
[] arr)
{
import std.string;
return arr.assumeUTF;
}
```
...and accidentally end up with a "string" pointing at mutable
data.
Am I missing something?
https://issues.dlang.org/show_bug.cgi?id=9149
Walter Bright changed:
What|Removed |Added
Keywords||safe
CC|
https://issues.dlang.org/show_bug.cgi?id=9149
--- Comment #16 from timon.g...@gmx.ch ---
(In reply to timon.gehr from comment #11)
>
> The fix I originally proposed in the first post removes the unsoundness in
> the const system, but it is ugly. It means the line "const x = y;" fails if
> y is a
|delegates to const |delegates with a mutable
||context
--
|--- |FIXED
--- Comment #2 from Dlang Bot ---
dlang/dmd pull request #15827 "Fix Issue 24248 - const constructor call with
mutable target gives wrong error message" was merged into master:
- 9c9b764e0f9fd55734ebed393f59cf87257ebb63 by Nick Treleaven:
Fix Issue 24248 - const constr
created dlang/dmd pull request #15827 "Fix Issue 24248 - const
constructor call with mutable target gives wrong error message" fixing this
issue:
- Fix Issue 24248 - const constructor call with mutable target gives wrong
error message
https://github.com/dlang/dmd/pull/15827
--
https://issues.dlang.org/show_bug.cgi?id=24248
Nick Treleaven changed:
What|Removed |Added
Keywords||diagnostic
--
with
|mutable target gives wrong |mutable target gives wrong
|error message |error message
--
https://issues.dlang.org/show_bug.cgi?id=24248
Issue ID: 24248
Summary: const constructor with mutable target gives wrong
error message
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status
https://issues.dlang.org/show_bug.cgi?id=24073
Issue ID: 24073
Summary: Compiler should explain why implicit conversion to
mutable fails
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
https://issues.dlang.org/show_bug.cgi?id=24051
Dlang Bot changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
https://issues.dlang.org/show_bug.cgi?id=24051
Dlang Bot changed:
What|Removed |Added
Keywords||pull
--- Comment #1 from Dlang Bot ---
https://issues.dlang.org/show_bug.cgi?id=24051
Basile-z changed:
What|Removed |Added
Keywords||accepts-invalid
--
https://issues.dlang.org/show_bug.cgi?id=24051
Issue ID: 24051
Summary: Safety attrib inference of enum/immut/const decls
inconsistent with mutable static variable decls
Product: D
Version: D2
Hardware: All
On Monday, 5 June 2023 at 18:54:30 UTC, cc wrote:
[...]
Is there a way to check for mutability as well? I have both
immutable and mutable fields. I would like to generate setters
for mutable fields only.
On 6/6/23 09:13, Basile B. wrote:
> yeah I know that opDispatch is disliked because it is tried in a SFINAE
> fashion, as citicized by Adam. But on the other side it's the best
opover.
I like how it helped in my current project:
user.someShellCommand("-foo", "-bar");
opDispatch makes a
On Tuesday, 6 June 2023 at 14:23:59 UTC, Steven Schveighoffer
wrote:
On 6/5/23 11:33 AM, Basile B. wrote:
[...]
Ugh, don't do it that way. Always give opDispatch a template
constraint or it will suck to use.
Also, given the problem constraints, you can build the method
automatically using
On 6/5/23 11:33 AM, Basile B. wrote:
On Monday, 5 June 2023 at 15:13:43 UTC, Basile B. wrote:
On Monday, 5 June 2023 at 13:57:20 UTC, Ki Rill wrote:
How do I generate `setX` methods for all private mutable
although I did not spent time on the setter body... I suppose the
question was more
On Monday, 5 June 2023 at 15:28:34 UTC, Paul Backus wrote:
Is there a reason you can't just make these fields `public`?
My bet is that OP actually wants to generate something like
```d
void setStrokeWidth(uint value)
{
if (value = strokeWidth) return;
strokeWidth = value;
On Monday, 5 June 2023 at 15:28:34 UTC, Paul Backus wrote:
Is there a reason you can't just make these fields `public`?
My bet is that OP actually wants to generate something like
```d
void setStrokeWidth(uint value)
{
if (value = strokeWidth) return;
strokeWidth = value;
On Monday, 5 June 2023 at 18:54:30 UTC, cc wrote:
On Monday, 5 June 2023 at 13:57:20 UTC, Ki Rill wrote:
How do I generate `setX` methods for all private mutable
variables in my class? Do I need to use `__traits`?
```d
mixin template GenerateSetters() {
static foreach (idx, field; typeof
On Monday, 5 June 2023 at 13:57:20 UTC, Ki Rill wrote:
How do I generate `setX` methods for all private mutable
variables in my class? Do I need to use `__traits`?
```d
mixin template GenerateSetters() {
static foreach (idx, field; typeof(this).tupleof) static if
(__traits(getVisibility
On Monday, 5 June 2023 at 15:13:43 UTC, Basile B. wrote:
On Monday, 5 June 2023 at 13:57:20 UTC, Ki Rill wrote:
How do I generate `setX` methods for all private mutable
although I did not spent time on the setter body... I suppose
the question was more about the metprogramming technic
On Monday, 5 June 2023 at 13:57:20 UTC, Ki Rill wrote:
How do I generate `setX` methods for all private mutable
variables in my class? Do I need to use `__traits`?
I need this for my
[tiny-svg](https://github.com/rillki/tiny-svg) project to
generate `setX` methods for all Shapes.
Example
On Monday, 5 June 2023 at 13:57:20 UTC, Ki Rill wrote:
How do I generate `setX` methods for all private mutable
variables in my class? Do I need to use `__traits`?
I need this for my
[tiny-svg](https://github.com/rillki/tiny-svg) project to
generate `setX` methods for all Shapes.
Example
How do I generate `setX` methods for all private mutable
variables in my class? Do I need to use `__traits`?
I need this for my [tiny-svg](https://github.com/rillki/tiny-svg)
project to generate `setX` methods for all Shapes.
Example:
```D
class Rectangle {
private immutable
doesn’t
give you such a strong guarantee, disallows ‘you’ from
modifying it but others might do so, but who knows.
There are two perspectives: that of the value handed to a
function and that of the function taking the value.
"immutable" (or "mutable") is a property
’ from
modifying it but others might do so, but who knows.
There are two perspectives: that of the value handed to a
function and that of the function taking the value.
"immutable" (or "mutable") is a property of the value, "const" is
a property of the function.
If the
On Wednesday, 31 May 2023 at 03:23:01 UTC, Cecil Ward wrote:
On Tuesday, 30 May 2023 at 04:15:22 UTC, Ali Çehreli wrote:
On 5/29/23 19:57, Cecil Ward wrote:
> I wish to have one routine
> that can be called with either immutable or (possibly)
mutable argument
> values.
'const' sh
On Tuesday, 30 May 2023 at 04:15:22 UTC, Ali Çehreli wrote:
On 5/29/23 19:57, Cecil Ward wrote:
> I wish to have one routine
> that can be called with either immutable or (possibly)
mutable argument
> values.
'const' should take both immutable and mutable. Can you show
your case wit
On 5/29/23 10:57 PM, Cecil Ward wrote:
I have often come into difficulties where I wish to have one routine
that can be called with either immutable or (possibly) mutable argument
values. The argument(s) in question are in, readonly, passed by value or
passed by const reference. Anyway, no one
On 5/29/23 19:57, Cecil Ward wrote:
> I wish to have one routine
> that can be called with either immutable or (possibly) mutable argument
> values.
'const' should take both immutable and mutable. Can you show your case
with a short example?
> Could I make the one routine int
On Tuesday, 30 May 2023 at 02:57:52 UTC, Cecil Ward wrote:
I have often come into difficulties where I wish to have one
routine that can be called with either immutable or (possibly)
mutable argument values. The argument(s) in question are in,
readonly, passed by value or passed by const
I have often come into difficulties where I wish to have one
routine that can be called with either immutable or (possibly)
mutable argument values. The argument(s) in question are in,
readonly, passed by value or passed by const reference. Anyway,
no one is trying to write to the items passed
On Monday, 10 April 2023 at 20:31:43 UTC, Steven Schveighoffer
wrote:
On 4/10/23 4:25 PM, Steven Schveighoffer wrote:
It's also completely useless. Having const keys does nothing
to guarantee unchanging keys. Another half-assed attempt to be
encode correct semantics but fails completely in its
On 4/10/23 4:25 PM, Steven Schveighoffer wrote:
It's also completely useless. Having const keys does nothing to
guarantee unchanging keys. Another half-assed attempt to be encode
correct semantics but fails completely in its goal.
In case you wonder how old this is:
On 4/10/23 2:14 PM, John Colvin wrote:
It seems that it isn't possible, am I missing something?
alias Q = int[int*];
pragma(msg, Q); // int[const(int)*]
Yep, it's been that way forever. Only with pointers and arrays. It's
fine with mutable classes and structs (even if they contain pointers
On Monday, 10 April 2023 at 18:14:56 UTC, John Colvin wrote:
It seems that it isn't possible, am I missing something?
alias Q = int[int*];
pragma(msg, Q); // int[const(int)*]
Also, is this documented somewhere?
It seems to be so (which is strange) and I can't image it is by
design since you
It seems that it isn't possible, am I missing something?
alias Q = int[int*];
pragma(msg, Q); // int[const(int)*]
Also, is this documented somewhere?
https://issues.dlang.org/show_bug.cgi?id=13628
RazvanN changed:
What|Removed |Added
Status|REOPENED|RESOLVED
CC|
https://issues.dlang.org/show_bug.cgi?id=12682
RazvanN changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
https://issues.dlang.org/show_bug.cgi?id=11107
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P3
--
https://issues.dlang.org/show_bug.cgi?id=7355
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P3
--
https://issues.dlang.org/show_bug.cgi?id=5325
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P4
--
https://issues.dlang.org/show_bug.cgi?id=7013
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P4
--
https://issues.dlang.org/show_bug.cgi?id=1654
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P4
--
https://issues.dlang.org/show_bug.cgi?id=6247
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P4
--
https://issues.dlang.org/show_bug.cgi?id=23375
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P2
--
https://issues.dlang.org/show_bug.cgi?id=19817
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P2
--
https://issues.dlang.org/show_bug.cgi?id=17766
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P2
--
https://issues.dlang.org/show_bug.cgi?id=12885
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P2
--
https://issues.dlang.org/show_bug.cgi?id=13628
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P3
--
https://issues.dlang.org/show_bug.cgi?id=13622
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P3
--
https://issues.dlang.org/show_bug.cgi?id=12682
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P3
--
https://issues.dlang.org/show_bug.cgi?id=16585
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P3
--
https://issues.dlang.org/show_bug.cgi?id=21958
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P3
--
https://issues.dlang.org/show_bug.cgi?id=14148
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P3
--
https://issues.dlang.org/show_bug.cgi?id=15942
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P3
--
https://issues.dlang.org/show_bug.cgi?id=21015
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P3
--
https://issues.dlang.org/show_bug.cgi?id=19363
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P3
--
https://issues.dlang.org/show_bug.cgi?id=22244
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P3
--
https://issues.dlang.org/show_bug.cgi?id=12883
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P4
--
https://issues.dlang.org/show_bug.cgi?id=19279
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P4
--
https://issues.dlang.org/show_bug.cgi?id=19879
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P4
--
https://issues.dlang.org/show_bug.cgi?id=20031
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P4
--
https://issues.dlang.org/show_bug.cgi?id=14017
--- Comment #4 from Steven Schveighoffer ---
To address the original statement as well, if f returns a character array, it
now compiles. And this is to be expected.
--
https://issues.dlang.org/show_bug.cgi?id=14017
RazvanN changed:
What|Removed |Added
Status|NEW |RESOLVED
CC|
|--- |FIXED
--- Comment #4 from Dlang Bot ---
dlang/phobos pull request #8644 "Fix Issue 23319 - std.range.Generator does not
work with non-mutable elements" was merged into master:
- af267271c6fb4c203435ae8e4d45cf9edde9df5e by RazvanN7:
Fix Issue 23319 - std.range.Generator doe
---
@RazvanN7 created dlang/phobos pull request #8644 "Fix Issue 23319 -
std.range.Generator does not work with non-mutable elements" fixing this issue:
- Fix Issue 23319 - std.range.Generator does not work with non-mutable elements
https://github.com/dlang/phobos/pull/8644
--
https://issues.dlang.org/show_bug.cgi?id=23319
--- Comment #2 from Ali Cehreli ---
Thank you for an alternative but it has the same limitation, right?
gen!(() => const(int)(42));
deneme.d(4431): Error: cannot modify `const` expression `this.func`
deneme.d(4448): Error: template instance
https://issues.dlang.org/show_bug.cgi?id=23319
Salih Dincer changed:
What|Removed |Added
CC||sali...@hotmail.com
--- Comment #1 from
https://issues.dlang.org/show_bug.cgi?id=17240
RazvanN changed:
What|Removed |Added
Status|NEW |RESOLVED
CC|
|--- |FIXED
--- Comment #2 from Dlang Bot ---
dlang/dlang.org pull request #3447 "Fix 23436 - Spec falsely states mutable
references in struct .init ar…" was merged into master:
- 4a0af0866a28d7f196406d9266971ea93e45ff61 by Paul Backus:
Fix 23436 - Spec falsely states mutable
---
@pbackus created dlang/dlang.org pull request #3447 "Fix 23436 - Spec falsely
states mutable references in struct .init ar…" fixing this issue:
- Fix 23436 - Spec falsely states mutable references in struct .init are
forbidden
https://github.com/dlang/dlang.org/pull/3447
--
https://issues.dlang.org/show_bug.cgi?id=23436
Issue ID: 23436
Summary: Spec falsely states mutable references in struct .init
are forbidden
Product: D
Version: D2
Hardware: All
OS: All
Status
https://issues.dlang.org/show_bug.cgi?id=22244
--- Comment #1 from FeepingCreature ---
Simpler demonstration of the issue:
```
immutable int[string] foo;
immutable(int)[string] bar = foo;
```
This should work, because if we cast it:
```
immutable int[string] foo;
immutable(int)[string] bar =
https://issues.dlang.org/show_bug.cgi?id=23375
ZombineDev changed:
What|Removed |Added
CC||petar.p.ki...@gmail.com
--
https://issues.dlang.org/show_bug.cgi?id=23375
--- Comment #2 from Bolpat ---
As enum was intended to be a replacement of C’s `#define` constants, the
compiler should thoroughly treat `enum` as a named literal; it can support
“mutable” indirections, but a lot more has to be taken. By “mutable” I
1 - 100 of 1121 matches
Mail list logo