Skip to content

[scope] fix Issue 17076 don't infer 'return' if return type doesn't have pointers#6420

Merged
andralex merged 1 commit intodlang:masterfrom
WalterBright:ret-ptrs
Jan 9, 2017
Merged

[scope] fix Issue 17076 don't infer 'return' if return type doesn't have pointers#6420
andralex merged 1 commit intodlang:masterfrom
WalterBright:ret-ptrs

Conversation

@WalterBright
Copy link
Member

Accomplished by not needing to check escaping pointers via return if the return type doesn't have indirections.

@WalterBright
Copy link
Member Author

Blocking dlang/druntime#1733

@WalterBright WalterBright added the Review:Blocking Other Work review and pulling should be a priority label Jan 9, 2017
@rainers
Copy link
Member

rainers commented Jan 9, 2017

Also fixes https://issues.dlang.org/show_bug.cgi?id=17076, which is the same as the test case.

I've just browsed the code cursorily, but shouldn't it avoid inferring return for value parameters to begin with?

@WalterBright
Copy link
Member Author

If the int parameter is cast to a pointer, it should infer. That's why the check is on the return type.

@WalterBright WalterBright changed the title [scope] don't infer 'return' if return type doesn't have pointers [scope] fix Issue 17076 don't infer 'return' if return type doesn't have pointers Jan 9, 2017
@andralex
Copy link
Member

andralex commented Jan 9, 2017

Kudos to anyone who can explain how I can figure why circleci failed.

@andralex andralex merged commit e11a1cd into dlang:master Jan 9, 2017
@WalterBright WalterBright deleted the ret-ptrs branch January 10, 2017 06:29
tramker pushed a commit to tramker/dmd that referenced this pull request Jun 14, 2017
[scope] fix Issue 17076 don't infer 'return' if return type doesn't have pointers

[REG2.073] Fix Issue 17117 - erroneous "escaping reference to local variable"

Signed-off-by: Martin Krejcirik <mk@krej.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review:Blocking Other Work review and pulling should be a priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants