Issue 24687 - [REG2.110] Cannot cast string-imports to select overload anymore
Summary: [REG2.110] Cannot cast string-imports to select overload anymore
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2024-07-29 12:40 UTC by kinke
Modified: 2024-11-16 23:27 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description kinke 2024-07-29 12:40:52 UTC
This fails with current stable (v2.110.0-beta.1+), but worked with v2.109:
```
void foo(string path);
void foo(const(ubyte[]) data);

void bar1() { foo(import("bla.txt")); } // matches both
void bar2() { foo(cast(const(ubyte[])) import("bla.txt")); } // matches both!
```

Output:
```
reg.d(4): Error: `reg.foo` called with argument types `(string)` matches both:
reg.d(1):     `reg.foo(string path)`
and:
reg.d(2):     `reg.foo(const(ubyte[]) data)`
reg.d(5): Error: `reg.foo` called with argument types `(const(ubyte[]))` matches both:
reg.d(1):     `reg.foo(string path)`
and:
reg.d(2):     `reg.foo(const(ubyte[]) data)`
```
Comment 1 Adam D. Ruppe 2024-07-29 12:50:49 UTC
probably related to the hex string flag recently merged that lets it implicitly cast either way.
Comment 2 Dlang Bot 2024-08-05 15:51:04 UTC
@RazvanN7 created dlang/dmd pull request #16770 "Fix Bugzilla Issue 24687 - [REG2.110] Cannot cast string-imports to select overload anymore" fixing this issue:

- Fix Bugzilla Issue 24687 - [REG2.110] Cannot cast string-imports to select overload anymore

https://github.com/dlang/dmd/pull/16770
Comment 3 Dlang Bot 2024-08-06 00:07:48 UTC
dlang/dmd pull request #16770 "Fix Bugzilla Issue 24687 - [REG2.110] Cannot cast string-imports to select overload anymore" was merged into stable:

- 26388210582cee231823774feb307ca9b61e7777 by RazvanN7:
  Fix Bugzilla Issue 24687 - [REG2.110] Cannot cast string-imports to select overload anymore

https://github.com/dlang/dmd/pull/16770
Comment 4 Dlang Bot 2024-10-07 09:00:26 UTC
dlang/dmd pull request #16967 "Rebase stable6" was merged into master:

- 6d09335cd20b1e6e9529c1e2715ce78a68bdc48d by RazvanN7:
  Fix Bugzilla Issue 24687 - [REG2.110] Cannot cast string-imports to select overload anymore

https://github.com/dlang/dmd/pull/16967
Comment 5 Dlang Bot 2024-11-16 23:27:10 UTC
dlang/dmd pull request #17069 "Merge stable" was merged into master:

- 29a34181da51bff45a78f51cf5889349499d0dca by RazvanN7:
  Fix Bugzilla Issue 24687 - [REG2.110] Cannot cast string-imports to select overload anymore

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