Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elixir 1.10.2 fixes #185

Merged
merged 1 commit into from
Feb 27, 2020
Merged

elixir 1.10.2 fixes #185

merged 1 commit into from
Feb 27, 2020

Conversation

ethangunderson
Copy link
Contributor

When upgrading one of my apps to Elixir 1.10 I ran into a function clause error

        # 2
        :defp
    
        # 3
        :name_of_function
    
        # 4
        [{:http_result, [line: 347], nil}, {:\\, [line: 347], [{:ok_code_or_codes, [line: 347], nil}, 200]}]
    
        # 5
        []
    
        # 6
        []
    
    Attempted function clauses (showing 3 out of 3):
    
        def __on_definition__(_env, _access, _name, _args, _guards, nil)
        def __on_definition__(env, _access, name, _args, _guards, [do: _, rescue: _])
        def __on_definition__(%{module: module}, access, name, args, guards, [do: body])

The test suite already had a failure when running under 1.10, so I just added the missing function head. I also added the Elixir version under the travis config.

Let me know if there's anything else I should do before getting this merged. Thanks!

@claassistantio
Copy link

claassistantio commented Feb 27, 2020

CLA assistant check
All committers have signed the CLA.

@@ -17,6 +17,7 @@ defmodule NewRelic.Tracer.Macro do

# Take no action on the definition of a function head
def __on_definition__(_env, _access, _name, _args, _guards, nil), do: nil
def __on_definition__(_env, _access, _name, _args, _guards, []), do: nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice, so was it a function head definition that was causing the error? ie:

def foo(bar \\ :default)

or was this some other case..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, it was a function head definition.

Example of one from our codebase:

defp parse_response(http_result, ok_code_or_codes \\ 200)

@binaryseed
Copy link
Collaborator

Thanks for this!

@binaryseed binaryseed merged commit 2d681a7 into newrelic:master Feb 27, 2020
@ethangunderson ethangunderson deleted the elixir-1-10 branch February 27, 2020 01:20
@binaryseed
Copy link
Collaborator

Released as 1.16.5

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