https://issues.dlang.org/show_bug.cgi?id=24525
Dlang Bot changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
https://issues.dlang.org/show_bug.cgi?id=24525
Dlang Bot changed:
What|Removed |Added
Keywords||pull
--- Comment #4 from Dlang Bot ---
@ntrel
https://issues.dlang.org/show_bug.cgi?id=24525
Nick Treleaven changed:
What|Removed |Added
Assignee|nob...@puremagic.com|n...@geany.org
--
https://issues.dlang.org/show_bug.cgi?id=24525
basile-z changed:
What|Removed |Added
Summary|auto ref lambda exp not |auto ref lambda exp
e
none.
The parser should lookup after `auto`. If next is `(` or if next two are `ref`
then `(`, then it should takes the path of expression.
> It is unfortunate that the function literal syntax starting `ref` or `auto
> ref` was added, when the function/delegate keyword starting forms can alrea
https://issues.dlang.org/show_bug.cgi?id=24525
Nick Treleaven changed:
What|Removed |Added
Severity|enhancement |normal
--- Comment #2 from Nick Treleaven
edence.
For:
> ref () {return a;}() = 0;
A declaration `ref () {return a;}` gets parsed, not an ExpressionStatement. So
I think this issue is invalid.
It is unfortunate that the function literal syntax starting `ref` or `auto ref`
was added, when the function/delegate keyword starting forms ca
https://issues.dlang.org/show_bug.cgi?id=24525
Issue ID: 24525
Summary: auto ref lambda exp not parsed if used as left-most
expression in a expression statement
Product: D
Version: D2
Hardware: All
OS: All
https://issues.dlang.org/show_bug.cgi?id=24513
--- Comment #2 from basile-z ---
that's completly stupid. Nobody would accept that in phobos. Just imagine my
friend, someone who makes a PR that is like
```
pure takeWhile(T)(auto ref T t);
```
any human being would open a review comment to say
||dkor...@live.nl
Hardware|x86_64 |All
Resolution|--- |INVALID
OS|Linux |All
--- Comment #1 from Dennis ---
This is defined behavior:
https://dlang.org/spec/function.html#auto-functions
https://issues.dlang.org/show_bug.cgi?id=24513
Issue ID: 24513
Summary: `pure` can be used as `auto`
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Keywords: accepts-invalid, diagnostic
https://issues.dlang.org/show_bug.cgi?id=24385
Issue ID: 24385
Summary: Slicing a static array binds as non-ref when using
auto ref
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
On Saturday, 3 February 2024 at 02:20:13 UTC, Paul Backus wrote:
On Friday, 2 February 2024 at 23:25:37 UTC, Chris Katko wrote:
The auto solution won't work for a struct however which I'm
using:
```D
struct procTable{ //contains all the fields inside a file I'm
parsing
uint time;
int
On Friday, 2 February 2024 at 23:25:37 UTC, Chris Katko wrote:
The auto solution won't work for a struct however which I'm
using:
```D
struct procTable{ //contains all the fields inside a file I'm
parsing
uint time;
int priority;
string name;
// etc
}
```
Maybe you can use
On Friday, 2 February 2024 at 21:01:53 UTC, Paul Backus wrote:
No, D only does bottom-up type inference, not top down.
If you want to avoid repeating the type, use `auto` on the left
side:
```d
auto time = to!uint(data[1]);
auto priority = to!int(data[2]);
```
Okay thanks. It finally
On Friday, 2 February 2024 at 07:43:09 UTC, Chris Katko wrote:
Is there some way to do:
```D
string[3] data; //strings from some file input, some are ints,
uints, etc.
auto into!(T)(T value){return to!???(value); } // ???
uint time = into!(data[1]); // We already know this is uint
int
Is there some way to do:
```D
string[3] data; //strings from some file input, some are ints,
uints, etc.
auto into!(T)(T value){return to!???(value); } // ???
uint time = into!(data[1]); // We already know this is uint
int priority = into!(data[2]);
```
instead of:
```D
uint time = to!uint
On Wednesday, 24 January 2024 at 08:22:49 UTC, Walter Bright
wrote:
On 1/23/2024 8:01 AM, Steven Schveighoffer wrote:
zero proposals that infer type from how they are used have
been accepted by Walter, this one probably will be no
different.
Types are inferred in D from the bottom up. Mixing
On 1/23/2024 8:01 AM, Steven Schveighoffer wrote:
zero proposals that infer type from how they are used
have been accepted by Walter, this one probably will be no different.
Types are inferred in D from the bottom up. Mixing in special cases of it being
top down leads to confusion over how
also can do some library tricks (unfortunately this won't
count as construction, but probably is fine in most cases)
```d
auto create(T, Args...)(out T val, Args args)
{
static if(is(T == class))
val = new T(args);
else static if(...) // do eveyrything else.
}
...
dataGrid.create(15
On Tuesday, January 23, 2024 4:11:00 AM MST ryuukk_ via Digitalmars-d-announce
wrote:
> On Tuesday, 23 January 2024 at 06:30:08 UTC, Jonathan M Davis
>
> wrote:
> > That being said, I expect that it would be pretty easy to write
> > a mixin to do something like that if you really wanted to.
> >
On Tuesday, 23 January 2024 at 11:11:00 UTC, ryuukk_ wrote:
[OT] btw what did you find? Which one could you recommend?
https://forum.dlang.org/post/cqgrciflmvuwonsnz...@forum.dlang.org
On Tuesday, 23 January 2024 at 06:30:08 UTC, Jonathan M Davis
wrote:
That being said, I expect that it would be pretty easy to write
a mixin to do something like that if you really wanted to.
Also, if you're simply looking to not have to name the type,
you could do
dataGrid = new
)
>{
>dataGrid = new auto(15); // <--- new
>// instead of
>dataGrid = new dataGridLayerView(15);
>}
> }
> ```
>
> Because it seems, conceptually, the compiler should know all the
> details required here to simply insert
```D
class dataGridLayerView{
int t;
this(int _t){
t = _t;
}
}
class myClass{
dataGridLayerView dataGrid;
this()
{
dataGrid = new auto(15); // <--- new
// instead of
dataGrid = new dataGridLayerView(15);
}
}
```
Because it se
https://issues.dlang.org/show_bug.cgi?id=20595
Basile-z changed:
What|Removed |Added
See Also||https://issues.dlang.org/sh
|
https://issues.dlang.org/show_bug.cgi?id=21434
--- Comment #1 from dlangBugzillaToGithub ---
THIS ISSUE HAS BEEN MOVED TO GITHUB
https://github.com/dlang/visuald/issues/254
DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO
GITHUB
--
https://issues.dlang.org/show_bug.cgi?id=16194
RazvanN changed:
What|Removed |Added
CC||snarwin+bugzi...@gmail.com
--- Comment #3 from
||alphaglosi...@gmail.com
Resolution|--- |INVALID
--- Comment #4 from Richard Cattermole ---
The inference can be seen when you use auto instead of scope inside of
safeUsage when you output the AST.
```d
struct Struct
{
int* p
https://issues.dlang.org/show_bug.cgi?id=23933
--- Comment #3 from RazvanN ---
So, if we enable attribute inference for all functions that have a body, this
will be fixed as a consequence. Or, the workaround would be to manually
annotate `hmm` as scope.
--
https://issues.dlang.org/show_bug.cgi?id=23933
--- Comment #2 from RazvanN ---
[...] for auto functions because a function body needs to be present*
--
RazvanN ---
Under the current specification this is not a bug, even though the behavior is
surprising. Attributes are inferred for auto functions because you a function
body needs to be present. Attributes are not inferred for non-auto functions,
even if the body is present.
--
https://issues.dlang.org/show_bug.cgi?id=23933
Atila Neves changed:
What|Removed |Added
Keywords||accepts-invalid, safe
--
https://issues.dlang.org/show_bug.cgi?id=23933
Issue ID: 23933
Summary: auto return type disables DIP1000 scope check
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
|--- |FIXED
--- Comment #4 from Dlang Bot ---
dlang/dmd pull request #15240 "Fix Issue 23914 - auto ref resolution on return
value prevented by noreturn" was merged into master:
- 883de397fb3a1405bdfaaa985abc905049c41fb0 by RazvanN7:
Fix Issue 23914 - auto ref resolution on re
https://issues.dlang.org/show_bug.cgi?id=23873
--- Comment #3 from Dlang Bot ---
dlang/dmd pull request #15238 "merge stable" was merged into master:
- c2f8f32de55ec635e65d8451a6a805f2f3ac5b2f by Razvan Nitu:
Fix Issue 23873 - [ICE] segfault on imported static if ; else auto x (#151
---
@RazvanN7 created dlang/dmd pull request #15240 "Fix Issue 23914 - auto ref
resolution on return value prevented by noreturn" fixing this issue:
- Fix Issue 23914 - auto ref resolution on return value prevented by noreturn
https://github.com/dlang/dmd/pull/15240
--
https://issues.dlang.org/show_bug.cgi?id=23917
--- Comment #2 from Vladimir Panteleev ---
(Oops, ignore above comment, got my return types mixed up.)
--
!
/ test.d
struct NC { @disable this(this); }
struct A
{
@property ref NC value() { assert(false); }
alias value this;
}
A a;
ref NC f1(ref return NC value) { return value; }
auto ref NC get1() { return f1(a); } // OK
ref T f2(T)(ref return T value) { return value; }
auto
https://issues.dlang.org/show_bug.cgi?id=23917
Issue ID: 23917
Summary: "ref" in alias this call not detected in "auto ref"
return resolution
Product: D
Version: D2
Hardware: All
OS: Al
https://issues.dlang.org/show_bug.cgi?id=23914
Vladimir Panteleev changed:
What|Removed |Added
Summary|"auto ref" resolution |"auto
https://issues.dlang.org/show_bug.cgi?id=23914
--- Comment #2 from Vladimir Panteleev ---
No.
--
`auto ref` for template function parameters only?
--
https://issues.dlang.org/show_bug.cgi?id=23914
Vladimir Panteleev changed:
What|Removed |Added
Summary|"auto ref" determination|"auto
https://issues.dlang.org/show_bug.cgi?id=23914
Issue ID: 23914
Summary: "auto ref" determination prevented by bottom type
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severi
---
@RazvanN7 created dlang/dmd pull request #15214 "Fix Issue 18151 - wrong auto
ref lvalue inference for implicitly converted alias this parameters" fixing
this issue:
- Fix Issue 18151 - wrong auto ref lvalue inference for implicitly converted
alias this parameters
https://github.com/dlang/dmd/pull/15214
--
|--- |FIXED
--- Comment #2 from Dlang Bot ---
dlang/dmd pull request #15168 "Fix Issue 23873 - [ICE] segfault on imported
static if ; else auto x" was merged into stable:
- e6c2ecf729a84e38e6746ad23bfa9ecd0d38491c by RazvanN7:
Fix Issue 23873 - [ICE] segfault on imported static
---
@RazvanN7 created dlang/dmd pull request #15168 "Fix Issue 23873 - [ICE]
segfault on imported static if ; else auto x" fixing this issue:
- Fix Issue 23873 - [ICE] segfault on imported static if ; else auto x
https://github.com/dlang/dmd/pull/15168
--
https://issues.dlang.org/show_bug.cgi?id=23873
RazvanN changed:
What|Removed |Added
Keywords||ice
CC|
https://issues.dlang.org/show_bug.cgi?id=23873
Issue ID: 23873
Summary: [ICE] segfault on imported `static if ; else auto x`
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity
https://issues.dlang.org/show_bug.cgi?id=23833
--- Comment #2 from james.g...@remss.net ---
(In reply to RazvanN from comment #1)
> The compiler does auto dereferencing only when the lhs of a dot expression
> is a pointer to an aggregate type (struct, class, interface, union). That
||razvan.nitu1...@gmail.com
Resolution|--- |WONTFIX
--- Comment #1 from RazvanN ---
The compiler does auto dereferencing only when the lhs of a dot expression is a
pointer to an aggregate type (struct, class, interface, union). That does not
mean
https://issues.dlang.org/show_bug.cgi?id=23833
Issue ID: 23833
Summary: auto dereferncing does work with alias this
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Treleaven ---
You can already do this with an OutStatement with a static assert:
auto f()
out (r)
{
static assert(is(typeof(r) : int));
}
do
{
return "";
}
Compiling this you get an error, and the out contract should/could be shown in
the docs (haven't checked).
--
On 3/12/23 06:07, DLearner wrote:
> 1. As a shorthand to make the type of the variable being declared the
> same as the type on the right hand side of an initial assignment.
As Adam explained, D already has type inference without a special keyword.
However, some places where 'auto' (or
On Sunday, 12 March 2023 at 13:27:05 UTC, Adam D Ruppe wrote:
[...] *any* storage class will work for type inference. [...]
After heaving read [1] I immediately thought of this:
void main ()
{
deprecated i = 3;
i = 4;
}
$ dmd test.d
test.d(4): Deprecation: variable
On Sunday, 12 March 2023 at 15:31:07 UTC, Salih Dincer wrote:
Moreover, `auto ref` or `ref auto` is needed in functions.
That's because `ref` isn't part of the argument or return value's
type, so it isn't covered by **type** inference. Instead, D has a
totally separate feature for "
.
The auto keyword is really helpful for shortening it. But in at
least 2 cases (one of which is interfaces) it should help the
compiler. For example, contrary to expected, it is dynamic array:
```d
auto arr = [ 1, 2, 3 ];
```
Moreover, `auto ref` or `ref auto` is needed in functions.
SDB@79
On Sunday, 12 March 2023 at 13:07:58 UTC, DLearner wrote:
Is it correct that this _single_ keyword is used to indicate
_two_ quite different things:
No, it only actually does #2 in your thing. The type is optional
meaning *any* storage class will work for type inference. `auto
Is it correct that this _single_ keyword is used to indicate
_two_ quite different things:
1. As a shorthand to make the type of the variable being declared
the same as the type on the right hand side of an initial
assignment.
Example: ```auto A = 5;``` makes A an int.
2. To indicate
https://issues.dlang.org/show_bug.cgi?id=23747
--- Comment #3 from RazvanN ---
(In reply to Mike S from comment #2)
> Ah noted, that is perhaps my mistake then. Looking at the specification
> again with this in mind, I now see how 'auto ref' is deducing the 'refness'
> of a
https://issues.dlang.org/show_bug.cgi?id=23747
--- Comment #2 from Mike S ---
Ah noted, that is perhaps my mistake then. Looking at the specification again
with this in mind, I now see how 'auto ref' is deducing the 'refness' of a
function.
This means 'auto ref' snd 'ref auto' have different
||razvan.nitu1...@gmail.com
Resolution|--- |INVALID
--- Comment #1 from RazvanN ---
This bug report is invalid.
All of the `auto ref` functions work as expected. `Auto ref` does not mean "ref
+ type deduction", but rather "deduce if a func
https://issues.dlang.org/show_bug.cgi?id=23747
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P3
--
https://issues.dlang.org/show_bug.cgi?id=23747
Issue ID: 23747
Summary: 'auto ref' function return signature does not flag
escaping a reference to local variable
Product: D
Version: D2
Hardware: x86_64
OS
Iain Buclaw ---
(In reply to Walter Bright from comment #1)
> Shouldn't _Thread_local override the auto default?
It does not, and the C11 spec makes this clear:
This paragraph under C11 6.2.4 - Storage durations of objects
"""
C11 6.2.4-5:
An object whose identifier is declar
from Walter Bright ---
Shouldn't _Thread_local override the auto default?
--
https://issues.dlang.org/show_bug.cgi?id=23715
Iain Buclaw changed:
What|Removed |Added
Keywords||accepts-invalid, ImportC
See Also|
https://issues.dlang.org/show_bug.cgi?id=23715
Issue ID: 23715
Summary: compilable/testcstuff1.c:273:23: error: function-scope
'tli' implicitly auto and declared '_Thread_local'
Product: D
Version: D2
Hardware: All
https://issues.dlang.org/show_bug.cgi?id=20619
John Hall changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
https://issues.dlang.org/show_bug.cgi?id=15368
--- Comment #3 from Dlang Bot ---
dlang/dmd pull request #14857 "merge stable" was merged into master:
- 3683d2384a4eecdc2f816177a04f3a52032f8f79 by Dennis:
fix 15368 - improve error message when using auto in foreach (#14839)
https://
|--- |FIXED
--- Comment #2 from Dlang Bot ---
dlang/dmd pull request #14839 "Fix 15368 - improve error message when using
auto in foreach" was merged into stable:
- e7c2729806c1e7328c736af1177b322942717f17 by Dennis Korpel:
fix 15368 - improve error message when using auto in fore
---
@dkorpel created dlang/dmd pull request #14839 "Fix 15368 - improve error
message when using auto in foreach" fixing this issue:
- fix 15368 - improve error message when using auto in foreach
https://github.com/dlang/dmd/pull/14839
--
||ibuc...@gdcproject.org
Resolution|--- |WONTFIX
--- Comment #9 from Iain Buclaw ---
The Auto-tester itself has been taken down.
--
https://issues.dlang.org/show_bug.cgi?id=23626
--- Comment #9 from Dlang Bot ---
dlang/dmd pull request #14821 "follow-up Issue 23626 - invert
trustSystemEqualsDefault initializer to true" was merged into master:
- c111eaedcdbe6b4a7da372e2b05cca1cbac4b677 by Iain Buclaw:
follow-up Issue 23626
https://issues.dlang.org/show_bug.cgi?id=23626
--- Comment #8 from Dlang Bot ---
dlang/dmd pull request #14823 "merge stable" was merged into master:
- 815eb678c704470d190fc63579428d481bf55063 by Iain Buclaw:
fix Issue 23626 - [REG2.096] Template deduction with auto cons
|--- |FIXED
--- Comment #7 from Dlang Bot ---
dlang/dmd pull request #14818 "fix Issue 23626 - [REG2.096] Template deduction
with auto const ref Args... and delegate" was merged into stable:
- ca530908ce1ce07d52f0c90aaa5f3824cbc7816e by Iain Buclaw:
fix Issue 23626 - [REG2.096
|--- |FIXED
--- Comment #6 from Walter Bright ---
(In reply to Nicholas Wilson from comment #0)
> extern(C) void main() {
> enum string[] a = ["a"];
> auto aa = a; // line 3
> }
Now produces the error:
test.d(3): Error: expression `["a"]
---
@ibuclaw created dlang/dmd pull request #14818 "fix Issue 23626 - [REG2.096]
Template deduction with auto const ref Args... and delegate" fixing this issue:
- fix Issue 23626 - [REG2.096] Template deduction with auto const ref Args...
and delegate
https://github.com/dlang/dmd/pull/14818
--
https://issues.dlang.org/show_bug.cgi?id=23626
--- Comment #5 from Iain Buclaw ---
Still 3 files, but one possible reduction.
space_reclaimer.d
```
void __trace_maybeDumpTupleToFile(Args)(ref const Args ) { }
auto as(Func)(Func) {}
@nogc void foo() { }
void assertOp(LHS)(LHS lhs
https://issues.dlang.org/show_bug.cgi?id=23626
--- Comment #4 from Iain Buclaw ---
(In reply to johanengelen from comment #0)
> void func_2(Dlg)(Dlg dlg) {
> __trace_maybeDumpTupleToFile(dlg);
> }
Just a suggestion, should this be `const Dlg` instead?
--
https://issues.dlang.org/show_bug.cgi?id=23626
Iain Buclaw changed:
What|Removed |Added
See Also||https://issues.dlang.org/sh
https://issues.dlang.org/show_bug.cgi?id=23626
Iain Buclaw changed:
What|Removed |Added
CC||ibuc...@gdcproject.org
See Also|
https://issues.dlang.org/show_bug.cgi?id=23626
--- Comment #1 from johanenge...@weka.io ---
This frontend change "fixes" the errors (3 lines removed):
diff dmd/mtype.d:
```
/** Extends TypeNext.constConv by also checking for matching attributes **/
override MATCH constConv(Type to)
{
https://issues.dlang.org/show_bug.cgi?id=23626
Issue ID: 23626
Summary: [REG2.096] Template deduction with auto const ref
Args... and delegate
Product: D
Version: D2
Hardware: All
OS: All
Status
https://issues.dlang.org/show_bug.cgi?id=23626
johanenge...@weka.io changed:
What|Removed |Added
Keywords||industry, rejects-valid
--
https://issues.dlang.org/show_bug.cgi?id=18151
Iain Buclaw changed:
What|Removed |Added
Priority|P3 |P2
--
https://issues.dlang.org/show_bug.cgi?id=5288
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P3
--
https://issues.dlang.org/show_bug.cgi?id=6532
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P3
--
https://issues.dlang.org/show_bug.cgi?id=8204
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P3
--
https://issues.dlang.org/show_bug.cgi?id=9203
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P3
--
https://issues.dlang.org/show_bug.cgi?id=10574
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P3
--
https://issues.dlang.org/show_bug.cgi?id=7381
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P4
--
https://issues.dlang.org/show_bug.cgi?id=5436
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P4
--
https://issues.dlang.org/show_bug.cgi?id=9165
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P4
--
https://issues.dlang.org/show_bug.cgi?id=12488
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P4
--
https://issues.dlang.org/show_bug.cgi?id=11235
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P4
--
https://issues.dlang.org/show_bug.cgi?id=4707
Iain Buclaw changed:
What|Removed |Added
Priority|P2 |P4
--
https://issues.dlang.org/show_bug.cgi?id=23403
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P2
--
https://issues.dlang.org/show_bug.cgi?id=16041
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P3
--
1 - 100 of 2909 matches
Mail list logo