Skip to content

func: Clarify traverseIndirections()#7180

Merged
WalterBright merged 1 commit intodlang:masterfrom
dnadlinger:clarify-traverse-indirections
Oct 4, 2017
Merged

func: Clarify traverseIndirections()#7180
WalterBright merged 1 commit intodlang:masterfrom
dnadlinger:clarify-traverse-indirections

Conversation

@dnadlinger
Copy link
Contributor

This is the type-based alias analysis implementation used to
allow mutable -> immutable for pure factory functions.

No functional change intended.

(@WalterBright: As per discussion in #3085 – hope this helps.)

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @klickverbot!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@dnadlinger dnadlinger force-pushed the clarify-traverse-indirections branch 2 times, most recently from 84d8727 to a4be70b Compare October 3, 2017 21:01
This is the type-based alias analysis implementation used to
allow mutable -> immutable for pure factory functions.

No functional change intended.
@dnadlinger dnadlinger force-pushed the clarify-traverse-indirections branch from a4be70b to 8d8ff84 Compare October 3, 2017 21:32
@dnadlinger
Copy link
Contributor Author

(Fixed whitespace.)

*
* This relation is not symmetric in the two arguments. For example, a
* a `const(int)` reference can point to a pre-existing `int`, but not the other
* way round.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs params: section.

// `ta` and `tb` while avoiding cycles. Start with the original types.
return traverseIndirectionsImpl(ta, tb, null, false);
}
private bool traverseIndirectionsImpl(Type ta, Type tb, void* p, bool reversePass)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a function nested within traverseIndirections

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, making it a nested function also eliminates the casting of the void* parameter, which makes the function safe.

@WalterBright WalterBright merged commit 69a14c9 into dlang:master Oct 4, 2017
@WalterBright
Copy link
Member

@klickverbot I found the source of the trouble, though I am not sure how to fix it. Detailed in https://issues.dlang.org/show_bug.cgi?id=17635

@dnadlinger dnadlinger deleted the clarify-traverse-indirections branch October 5, 2017 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants