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

Prevent crash when encountering the 'any' type argument #96

Closed

Conversation

danielwhite
Copy link

This fixes #94 in which proper_typeserver would crash when resolving the
'erlang:timestamp()' type in OTP 17.x.

The underlying problem is that we were encountering the 'map()' type in
the erlang module with an argument of 'any'. At this point, the
typeserver only knew how to handle this situation for tuples.

Support has been extended to properly handle this argument for other
types, and the 'map()' type will now correctly be identified as
unsupported rather than causing a crash.

For example:

1> proper_typeserver:demo_translate_type(erlang, "map()").
{error,{unsupported_type,{type,1,map,any}}}

This fixes proper-testing#94 where proper_typeserver would crash when resolving the
'erlang:timestamp()' type in OTP 17.x.

The underlying problem is that we were encountering the 'map()' type in
the erlang module with an argument of 'any'. At this point, the
typeserver only knew how to handle this situation for tuples.

Support has been extended to properly handle this argument for other
types, and the 'map()' type will now correctly be identified as
unsupported rather than causing a crash.

For example:

1> proper_typeserver:demo_translate_type(erlang, "map()").
{error,{unsupported_type,{type,1,map,any}}}
@danielwhite
Copy link
Author

@kostis, any comment on this? I realise there is a conflict due to the introduction of user_type support, but would like to know if I'm barking up the wrong tree here.

@danielwhite
Copy link
Author

Assuming this is resolved due to #118.

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.

Native erlang:timestamp() type triggers error under Erlang/OTP 17.3
1 participant