Skip to content

Conversation

@crbelaus
Copy link
Contributor

Underscored functions are never imported by default. This should fix #90.

If you import the router on main you will see that the parse_options function is imported automatically:

iex(1)> import ErrorTracker.Web.Router
ErrorTracker.Web.Router
iex(2)> h parse_options
No documentation for ErrorTracker.Web.Router.parse_options was found

If you do the same now you will se that the function is not imported and it tries to find it in the Kernel module.

iex(1)> import ErrorTracker.Web.Router
ErrorTracker.Web.Router
iex(2)> h __parse_options__/2
No documentation for Kernel.__parse_options__/2 was found

Underscored functions are never imported by default.
@crbelaus crbelaus requested a review from odarriba September 10, 2024 14:06
@crbelaus crbelaus self-assigned this Sep 10, 2024
@crbelaus crbelaus changed the title Underscore private function name in router Don't import private function name from router Sep 10, 2024
Copy link
Contributor

@odarriba odarriba left a comment

Choose a reason for hiding this comment

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

Added a comment of a required change to be able to call the parse_options function which is no longer imported

@crbelaus crbelaus requested a review from odarriba September 10, 2024 14:57
@crbelaus crbelaus merged commit ac839f5 into main Sep 11, 2024
@crbelaus crbelaus deleted the dont-import-private-function-in-router branch September 11, 2024 08:04
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.

Router conflict with PhoenixAnalytics

3 participants