D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19064 - [REG2.081] getOverloads traits returns empty tuples for void functions
Summary: [REG2.081] getOverloads traits returns empty tuples for void functions
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:
Depends on:
Blocks:
 
Reported: 2018-07-05 12:48 UTC by Seb
Modified: 2018-07-11 11:43 UTC (History)
2 users (show)

See Also:


Attachments
A half-reduced version of Vibe.d (8.54 KB, application/x-compressed-tar)
2018-07-05 12:48 UTC, Seb
Details

Note You need to log in before you can comment on or make changes to this issue.
Description Seb 2018-07-05 12:48:28 UTC
Created attachment 1709 [details]
A half-reduced version of Vibe.d

Introduced by https://github.com/dlang/dmd/pull/7959

I'm still trying to reduce vibe-core, it's a bit difficult because DustMite is pretty greedy and just removing the mixin methods would also lead to the attribute not being found.
Comment 1 Seb 2018-07-05 13:10:20 UTC
Managed to find the root cause of the regression:

cat << EOF > minimal.d
enum IOMode { all}

struct blocking {}

interface InputStream {
	@safe:

	@property bool empty();

	@property ulong leastSize();

	@property bool dataAvailableForRead();

	const(ubyte)[] peek();

	size_t read(scope ubyte[] dst, IOMode mode);
	final void read(scope ubyte[] dst) { auto n = read(dst, IOMode.all); assert(n == dst.length); }
}


interface OutputStream {
	@safe:

	size_t write(in ubyte[] bytes, IOMode mode);
	final void write(in ubyte[] bytes) { auto n = write(bytes, IOMode.all); assert(n == bytes.length); }
	final void write(in char[] bytes) { write(cast(const(ubyte)[])bytes); }

	void flush();

	void finalize();
}

interface Stream : InputStream, OutputStream {
}


interface ConnectionStream : Stream {
	@safe:

	@property bool connected() const;
	void close();
}

static foreach (member; __traits(allMembers, ConnectionStream))
{
    pragma(msg, __traits(getOverloads, ConnectionStream, member));
}
EOF

with 2.080.1:

---
tuple(connected)                                                          
tuple(close)
tuple(empty)
tuple(leastSize)
tuple(dataAvailableForRead)
tuple(peek)
tuple(read, read)
tuple(write, write, write)
tuple(flush)
tuple(finalize)
---

with 2.081.0:

---
tuple()
tuple()
tuple(empty)
tuple(leastSize)
tuple(dataAvailableForRead)
tuple(peek)
tuple(read, read)
tuple(write, write, write)
tuple(flush)
tuple(finalize)
---

That's why the proxy-wrapping doesn't work.
Comment 2 Seb 2018-07-05 13:11:47 UTC
See also: https://github.com/vibe-d/vibe.d/issues/2181
Comment 3 RazvanN 2018-07-05 14:52:37 UTC
PR: https://github.com/dlang/dmd/pull/8456
Comment 4 Vladimir Panteleev 2018-07-05 20:00:18 UTC
(In reply to Seb from comment #0)
> I'm still trying to reduce vibe-core, it's a bit difficult because DustMite
> is pretty greedy and just removing the mixin methods would also lead to the
> attribute not being found.

The best way to reduce a regression is to invoke a working and broken compiler in the test script:

https://github.com/CyberShadow/DustMite/wiki/Reducing-a-regression-between-two-D-versions
Comment 5 github-bugzilla 2018-07-06 01:31:40 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/d3f65c73d521f0279c57fec4aec09d03f49b4028
Fix Issue 19064 - [REG2.081] Vibe.d's InterfaceProxy no longer works

https://github.com/dlang/dmd/commit/678a445c5a275d7dace466970b48cb2961341cd1
Merge pull request #8456 from RazvanN7/Issue_19064

Fix Issue 19064 - [REG2.081] Vibe.d's InterfaceProxy no longer works
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
Comment 6 basile-z 2018-07-11 11:43:38 UTC
*** Issue 19076 has been marked as a duplicate of this issue. ***