Bug 7159 – Forward reference when casting auto return method

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-12-23T06:02:00Z
Last change time
2013-01-24T21:08:30Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
robert
Blocks
340
See also
http://d.puremagic.com/issues/show_bug.cgi?id=5933

Comments

Comment #0 by robert — 2011-12-23T06:02:12Z
The following: ---- class HomeController { void* foo() { return cast(void*)&HomeController.displayDefault; } auto displayDefault() { return 1; } } ---- Gives the error: ---- merge.d(3): Error: forward reference to this.HomeController.displayDefault ---- When compiled with dmd 2.057 on ubuntu 32. Changing the return type of displayDefault to anything other than auto fixes the error. Possibly related to http://d.puremagic.com/issues/show_bug.cgi?id=5933
Comment #1 by k.hara.pg — 2012-02-19T07:31:40Z
Comment #2 by github-bugzilla — 2012-11-19T17:55:22Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a9bb24772b47cef1df237c7fdf95c52e3c27c418 fix Issue 7159 - Forward reference when casting auto return method https://github.com/D-Programming-Language/dmd/commit/2ba68e1db6cf3b2d19dfe4d3f7909ee67948bad3 Merge pull request #535 from 9rnsr/fix5933 Issue 5933 & 7159 - Resolve forward reference to auto-return member function
Comment #3 by k.hara.pg — 2013-01-23T22:52:00Z
(In reply to comment #1) > https://github.com/D-Programming-Language/dmd/pull/535 That was a wrong change, and it had been reverted. A new pull request is: https://github.com/D-Programming-Language/dmd/pull/1543
Comment #4 by github-bugzilla — 2013-01-24T14:27:53Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/3d5528e985270fe34a7298581df63958c88e506c fix Issue 7159 - Forward reference when casting auto return method https://github.com/D-Programming-Language/dmd/commit/de4f8f6bf8dc9fcc1730ea4d7f2bbd3e74880f08 Merge pull request #1543 from 9rnsr/fix5933 Issue 5933 & 7159 & 9377 - Invoke function semantic3 correctly where it is required.