D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 14244 - 2.067: Error when 'this' used as ref parameter
Summary: 2.067: Error when 'this' used as ref parameter
Status: RESOLVED DUPLICATE of issue 13934
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 regression
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-04 16:55 UTC by Dragos Carp
Modified: 2015-03-05 01:16 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 Dragos Carp 2015-03-04 16:55:28 UTC
class Foo
{
    public int baz()
    {
        return bar(this);
    }
}

public int bar(ref Foo foo)
{
    return 0;
}

int main()
{
    return 0;
}

2.066 compiles without error, 2.067-b3 outputs:

test.d(5) function test.bar (ref Foo foo) is not callable using argument types (Foo).
Comment 1 safety0ff.bugz 2015-03-04 20:26:03 UTC
Looks like it was a bug before and fixed in 2.067.
It might have been fixed as part of issue 13116.
The error message should be improved (IMO.)
Comment 2 Kenji Hara 2015-03-05 01:16:00 UTC

*** This issue has been marked as a duplicate of issue 13934 ***