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

ERL-301: Warning on inline #3424

Closed
OTP-Maintainer opened this issue Nov 17, 2016 · 3 comments
Closed

ERL-301: Warning on inline #3424

OTP-Maintainer opened this issue Nov 17, 2016 · 3 comments
Assignees
Labels
bug Issue is reported as a bug priority:low team:VM Assigned to OTP team VM
Milestone

Comments

@OTP-Maintainer
Copy link

Original reporter: cndenis
Affected versions: OTP-19.1.1, OTP-18.3
Fixed in version: OTP-19.2
Component: compiler
Migrated from: https://bugs.erlang.org/browse/ERL-301


A warning is generated when compiling the file in attachment with OTP 18 and 19.

No warning if not use inline.
No warning if delete the function compute/1.
No warning on OTP R16B03

{code:erlang}7> c(test).
test.erl:21: Warning: this clause cannot match because a previous clause at line 19 always matches

%% file test.erl

-module(test).

-compile([inline]).

-export([
    compute1/1,
    compute2/2
    ]).

compute1(X) ->
    add(X, 0).

compute2(X, Y) ->
    add(X, Y).

add(1, 0) ->
    1;
add(1, Y) ->
    1 + Y;
add(X, Y) ->
    X + Y.{code}







@OTP-Maintainer
Copy link
Author

bjorn said:

https://github.com/erlang/otp/pull/1247

@OTP-Maintainer
Copy link
Author

cndenis said:

Will this fix back port to 18.x branch?

@OTP-Maintainer
Copy link
Author

bjorn said:

Yes, I think that the fix will work in 18.x too.

@OTP-Maintainer OTP-Maintainer added bug Issue is reported as a bug team:VM Assigned to OTP team VM priority:low labels Feb 10, 2021
@OTP-Maintainer OTP-Maintainer added this to the OTP-19.2 milestone Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug priority:low team:VM Assigned to OTP team VM
Projects
None yet
Development

No branches or pull requests

2 participants