[Issue 23931] Error: reference to local variable `this` calling non-scope member function `this.this()`

2023-06-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23931

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #15368 "Fix Issue 23931 - Error: reference to local
variable `this` calling n…" was merged into master:

- 47154c4d59bab15cd5beec94d505a6391955640f by Nick Treleaven:
  Fix Issue 23931 - Error: reference to local variable `this` calling non-scope
member function `this.this()`

https://github.com/dlang/dmd/pull/15368

--


[Issue 15436] Compiler still refers to AliasSeq-s as "tuple"-s (and TypeTuple?)

2023-06-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15436

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #15363 "Fix Issue 15436 - Compiler still refers to
AliasSeq-s as "tuple"-s" was merged into master:

- 8cf2b41c2276d0491f3a0421dcd26dd4cfe17b83 by Nick Treleaven:
  Fix Issue 15436 - Compiler still refers to AliasSeq-s as "tuple"-s

  Replace "tuple type" with "type sequence".
  Replace "tuple" with "sequence".
  Pretty print `AliasSeq!(args)`, not `tuple(args)`.
  Leave json as "tuple" for now.
  Also mention std.typecons.Tuple when trying to return a sequence.

  Note: This does not rename any internal compiler symbols.

https://github.com/dlang/dmd/pull/15363

--


[Issue 24022] ImportC: Error: attribute `__anonymous` is used as a type

2023-06-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24022

Carsten Schlote  changed:

   What|Removed |Added

 CC||carsten.schl...@gmx.net

--- Comment #2 from Carsten Schlote  ---
Hi,
i stumbled over this regession bug, too. Simplyfied example to reproduce:

enum_decl.c:
---
/// @brief Type ID for signature block
typedef enum FWSIG_TYPE {
E_FWSIG_TYPE_RSA2048 = 0,
E_FWSIG_TYPE_RSA3072,
E_FWSIG_TYPE_RSA4096,
E_FWSIG_TYPE_EC256 = 16,
E_FWSIG_TYPE_ECP384,
E_FWSIG_TYPE_ECP521,
E_FWSIG_TYPE_ED25519 = 32,
E_FWSIG_TYPE_UNKNOWN = -1
}
E_FWSIG_TYPE;
---
use_enum_decl.d:
---
import enum_decl;

E_FWSIG_TYPE getEnumType(string blah)
{
E_FWSIG_TYPE type = E_FWSIG_TYPE_UNKNOWN;
return type;
}
---
$ dmd --version
DMD64 D Compiler v2.103.1
$ dmd -c use_enum_decl.d 
use_enum_decl.d(3): Error: attribute `__anonymous` is used as a type

$ dmd-beta --version
DMD64 D Compiler v2.104.1-beta.1-163-gb549aba8d6
$ dmd-beta -c use_enum_decl.d 
use_enum_decl.d(3): Error: attribute `__anonymous` is used as a type

$ ldc2 --version
LDC - the LLVM D compiler (1.32.1):
  based on DMD v2.102.2 and LLVM 15.0.7
$ ldc2 -c use_enum_decl.d
# Compiles fine as previous versions of DMD did.

--


[Issue 24023] New: Unnecessary module prefix in error message types

2023-06-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24023

  Issue ID: 24023
   Summary: Unnecessary module prefix in error message types
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: n...@geany.org

The following code (in callconst.d):

struct X {}

void main()
{
auto x = const X();
func(x);
}

void func(ref X);


Produces unnecessary module prefixes in the supplementary error line:

callconst.d(13): Error: function `callconst.func(ref X)` is not callable using
argument types `(const(X))`
callconst.d(13):cannot pass argument `x` of type `const(callconst.X)`
to parameter `ref callconst.X`

This just adds noise and could be removed.

PR incoming.

--


[Issue 24023] Unnecessary module prefix in error message types

2023-06-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24023

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@ntrel created dlang/dmd pull request #15370 "Fix Issue 24023 - Unnecessary
module prefix in error message types" fixing this issue:

- Fix Issue 24023 - Unnecessary module prefix in error message types

https://github.com/dlang/dmd/pull/15370

--


[Issue 24010] Destructor called before end of scope for tuples

2023-06-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24010

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Dlang Bot  ---
dlang/dmd pull request #15351 "Fix Issue 24010 - Destructor called before end
of scope for tuples" was merged into master:

- 597e133324fac8c1ded4d93186969727fd095fa7 by Boris Carvajal:
  Fix Issue 24010 - Destructor called before end of scope for tuples

  Co-authored-by: Walter Bright 

https://github.com/dlang/dmd/pull/15351

--


[Issue 24023] Unnecessary module prefix in error message types

2023-06-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24023

Dlang Bot  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #15370 "Fix Issue 24023 - Unnecessary module prefix in
error message types" was merged into master:

- c344ba9d8eb34710dc4d875150edfa7a8b0decd8 by Nick Treleaven:
  Fix Issue 24023 - Unnecessary module prefix in error message types

https://github.com/dlang/dmd/pull/15370

--


[Issue 24022] ImportC: Error: attribute `__anonymous` is used as a type

2023-06-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24022

Dmytro Katyukha  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

--- Comment #3 from Dmytro Katyukha  ---
The fix seems to be ready: https://github.com/dlang/dmd/pull/15365

Waiting for review.

@Carsten Schlote, Please, test the fix on your example (if you have time).

--


[Issue 24022] ImportC: Error: attribute `__anonymous` is used as a type

2023-06-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24022

Dmytro Katyukha  changed:

   What|Removed |Added

   Assignee|nob...@puremagic.com|firemage.d...@gmail.com

--


[Issue 15086] import doesn't verify module declaration

2023-06-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15086

--- Comment #31 from ag0aep6g  ---
I just ran into this one again in the wild.

Step 1: Start with a program that prints some data as an HTML table.

Step 2: Add another module to print the same data in CSV format. Do this by
copying html.d to csv.d and adjust as needed. Make sure you forget updating the
module declaration.

The resulting code (heavily simplified, of course):

--- main.d
module main;
void main()
{
const mode = "html";
if (mode == "csv")
{
import csv;
print();
}
else if (mode == "html")
{
import html;
print();
}
}
--- csv.d
module html; /* oopsie daisy */
void print()
{
import std.stdio;
writeln("foo,bar\nbaz,qux");
}
--- html.d
module html;
void print()
{
import std.stdio;
writeln("foobar" ~
"bazqux");
}
---

Step 3: Run with `dmd -i -run main.d`. Be surprised that it prints CSV even
though `mode` is clearly set to "html". Scratch your head. Stare at the screen.
Question your sanity.

Finally, figure out that you forgot to update the module declaration. Wonder
why the compiler didn't complain. Remember that bug you filed seven(!) years(!)
ago.

--


[Issue 24024] New: cannot pass class this to ref class

2023-06-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24024

  Issue ID: 24024
   Summary: cannot pass class this to ref class
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: major
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: bugzi...@digitalmars.com

class C
{
void mem()
{
foo(this); // fails
}
}

void foo(ref C);

void test()
{
C c;
foo(c); // passes
}
---
test.d(5): Error: function `test.foo(ref C)` is not callable using argument
types `(C)`
test.d(5):cannot pass rvalue argument `this` of type `test.C` to
parameter `ref C`

--