D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21668 - Cannot declare ref parameter of opaque type
Summary: Cannot declare ref parameter of opaque type
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 minor
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2021-02-28 02:51 UTC by moonlightsentinel
Modified: 2021-03-06 03:40 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description moonlightsentinel 2021-02-28 02:51:38 UTC
Functions cannot accept opaque types by ref (pointer and slices work already):

----------------------------------------
struct Opaque;

void byPtr(Opaque*) {}
void byRef(ref Opaque) {} // Fails
void bySlice(Opaque[]) {}
----------------------------------------
Comment 1 Dlang Bot 2021-02-28 03:01:56 UTC
@MoonlightSentinel created dlang/dmd pull request #12239 "Fix 21668 - Cannot declare ref parameter of opaque type" fixing this issue:

- Fix 21668 - Cannot declare ref parameter of opaque type
  
  Don't raise errors for VarDeclarations that are marked as ref

https://github.com/dlang/dmd/pull/12239
Comment 2 Dlang Bot 2021-02-28 03:29:39 UTC
@MoonlightSentinel created dlang/dmd pull request #12240 "Fix 14954 - extern opaque struct instance doesn't compile" fixing this issue:

- Fix 21668 - Cannot declare ref parameter of opaque type
  
  Don't raise errors for VarDeclarations that are marked as ref

https://github.com/dlang/dmd/pull/12240
Comment 3 Dlang Bot 2021-02-28 06:22:39 UTC
dlang/dmd pull request #12240 "Fix 14954 - extern opaque struct instance doesn't compile" was merged into master:

- fa1916b570007d52f950b82751b7c3fedc29877e by MoonlightSentinel:
  Fix 21668 - Cannot declare ref parameter of opaque type
  
  Don't raise errors for VarDeclarations that are marked as ref

https://github.com/dlang/dmd/pull/12240
Comment 4 Dlang Bot 2021-03-06 03:40:56 UTC
dlang/dmd pull request #12253 "merge stable" was merged into master:

- 8fda1152ab591143a20977ae24fcf7eaf5e2ec51 by Florian:
  Fix 21668 - Cannot declare ref parameter of opaque type (#12239)
  
  Don't raise errors for VarDeclarations that are marked as ref

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