https://issues.dlang.org/show_bug.cgi?id=20149
--- Comment #10 from Walter Bright ---
Here's what's actually happening. It has nothing to do with inout. A reduced
example:
-
@safe:
struct S {
this(int) { }
char[] opSlice() return { return buf[]; }
char[4] buf;
}
S bar();
https://issues.dlang.org/show_bug.cgi?id=20149
Walter Bright changed:
What|Removed |Added
CC||bugzi...@digitalmars.com
--- Comment #9 from
https://issues.dlang.org/show_bug.cgi?id=20149
--- Comment #8 from Dlang Bot ---
dlang/druntime pull request #2785 "Add `return` to `DSO.moduleGroup()` in
support of compiler fix for issue 20149" was merged into stable:
- 4f1568cf77085dd3ca9c5e0468c22382fcc28a0d by Mike:
Add `return` to `DSO.m
https://issues.dlang.org/show_bug.cgi?id=20149
--- Comment #7 from Dlang Bot ---
@JinShil created dlang/druntime pull request #2785 "Add `return` to
`DSO.moduleGroup()` in support of compiler fix for issue 20149" mentioning this
issue:
- Add `return` to `DSO.moduleGroup()` in support of compiler
https://issues.dlang.org/show_bug.cgi?id=20149
Dlang Bot changed:
What|Removed |Added
Keywords||pull
--- Comment #6 from Dlang Bot ---
@JinShil
https://issues.dlang.org/show_bug.cgi?id=20149
Mike Franklin changed:
What|Removed |Added
See Also||https://issues.dlang.org/sh
https://issues.dlang.org/show_bug.cgi?id=20149
Mike Franklin changed:
What|Removed |Added
See Also|https://issues.dlang.org/sh |
|ow_bug.cgi?id=19965
https://issues.dlang.org/show_bug.cgi?id=20149
--- Comment #5 from Mike Franklin ---
A more reduced test case:
---
import std.stdio;
@safe:
struct ScopeBuffer
{
this(char[4] init)
{
this.buf = init;
}
// The bug is that `inout` implies `return` on `this`.
// See
ht
https://issues.dlang.org/show_bug.cgi?id=20149
Mike Franklin changed:
What|Removed |Added
Keywords||accepts-invalid
--
https://issues.dlang.org/show_bug.cgi?id=20149
Mike Franklin changed:
What|Removed |Added
See Also||https://issues.dlang.org/sh
https://issues.dlang.org/show_bug.cgi?id=20149
--- Comment #4 from Mike Franklin ---
> Removing all templating from the example above cause the compiler to emit
> what I think is correct behavior:
That may mean this is a duplicate of Issue 19965, but I'm not sure.
--
https://issues.dlang.org/show_bug.cgi?id=20149
--- Comment #3 from Mike Franklin ---
Removing all templating from the example above cause the compiler to emit what
I think is correct behavior:
---
import std.stdio;
@safe:
struct ScopeBuffer
{
this(char[4] buf, size_t len = 0)
{
https://issues.dlang.org/show_bug.cgi?id=20149
--- Comment #2 from Mike Franklin ---
Interestingly removing the `inout` attribution on `opSlice` causes the compiler
to emit an error at the return statement in `fun`. I think the error should
instead be emitted at the return statement of `opSlice`
https://issues.dlang.org/show_bug.cgi?id=20149
--- Comment #1 from Mike Franklin ---
> Observation-2: Decorating `opSlice` with `return` causes a compiler error to
> be correctly emitted where the slice is escaping `foo`
In the example above, that should be `fun`, not `foo`.
--
https://issues.dlang.org/show_bug.cgi?id=20149
Mike Franklin changed:
What|Removed |Added
Keywords||safe
--
15 matches
Mail list logo