6825 – Regression(2.055+): Address of templated method incorrectly taken

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6825 - Regression(2.055+): Address of templated method incorrectly taken
Summary: Regression(2.055+): Address of templated method incorrectly taken
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All Linux
: P2 regression
Assignee: No Owner
URL:
Keywords: patch, rejects-valid
Depends on:
Blocks:
Reported: 2011年10月18日 06:36 UTC by Trass3r
Modified: 2015年06月09日 05:11 UTC (History)
2 users (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Trass3r 2011年10月18日 06:36:44 UTC
This worked in 2.055 but not with git dmd:
struct File
{
 void write(S...)(S args)
 {
 }
}
void dump(void delegate(string) d)
{
}
void save()
{
	auto o = File();
	dump(&o.write!string);
}
$ dmd test.d
DMD v2.056 DEBUG
dustmite.d(15): Error: expected 1 function arguments, not 0
dustmite.d(15): Error: o.write() is not an lvalue
dustmite.d(15): Error: function dustmite.dump (void delegate(string) d) is not callable using argument types (void*)
dustmite.d(15): Error: cannot implicitly convert expression (&o.write()) of type void* to void delegate(string)
Comment 1 Trass3r 2011年10月18日 07:16:14 UTC
Introduced in 2f37b7d according to git bisect.
Comment 2 Kenji Hara 2011年10月21日 03:42:20 UTC
> Introduced in 2f37b7d according to git bisect.
It is a bug of TemplateInstance::needsTypeInference that surfaced by that commit.
https://github.com/D-Programming-Language/dmd/pull/465 


AltStyle によって変換されたページ (->オリジナル) /