Bug 20447 – [REG 2.089] importing core.thread exposes unistd, hiding object.dup

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2019-12-13T11:11:48Z
Last change time
2020-01-05T23:51:59Z
Keywords
pull
Assigned to
No Owner
Creator
John Colvin

Comments

Comment #0 by john.loughran.colvin — 2019-12-13T11:11:48Z
void foo() { import core.thread; int[] a; auto b = a.dup; } dupmess.d(5): Error: function core.sys.posix.unistd.dup(int) is not callable using argument types (int[]) dupmess.d(5): cannot pass argument a of type int[] to parameter int
Comment #1 by bugzilla — 2019-12-18T22:17:54Z
I don't know why this is a regression. .dup was added to core.sys.posix.unistd 5 years ago?
Comment #2 by r.sagitario — 2020-01-04T16:56:40Z
(In reply to Walter Bright from comment #1) > I don't know why this is a regression. .dup was added to > core.sys.posix.unistd 5 years ago? The test case compiles up to 2.089. core.thread was refactored to a package, and this seems to uncover a bug with public imports leaking through private imports.
Comment #3 by r.sagitario — 2020-01-05T17:22:23Z
I've dustmited it to this: --- test.d void foo() { import p.b; int[] x; auto b = x.dup; } --- p/b.d module p.b; package import p.c; --- p/c.d module p.c; void dup(int); i.e. a package import leaks. Probably related: https://issues.dlang.org/show_bug.cgi?id=11065
Comment #4 by dlang-bot — 2020-01-05T17:35:02Z
@rainers created dlang/druntime pull request #2895 "fix Issue 20447 - [REG 2.089] importing core.thread exposes unistd, hidin…" fixing this issue: - fix Issue 20447 - [REG 2.089] importing core.thread exposes unistd, hiding object.dup avoid package import, it doesn't work as one would guess (due to spec missing) https://github.com/dlang/druntime/pull/2895
Comment #5 by dlang-bot — 2020-01-05T23:51:59Z
dlang/druntime pull request #2895 "fix Issue 20447 - [REG 2.089] importing core.thread exposes unistd, hidin…" was merged into stable: - c85fc34e62afd1d61d24f5cbd2f936691b57b701 by Rainer Schuetze: fix Issue 20447 - [REG 2.089] importing core.thread exposes unistd, hiding object.dup avoid package import, it doesn't work as one would guess (due to spec missing) https://github.com/dlang/druntime/pull/2895