diff options
author | Hans Bolinder <[email protected]> | 2014-05-23 09:24:17 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2014-05-23 09:24:17 +0200 |
commit | ddf75def890d6f6a19fe46b22604ac3d8a62040a (patch) | |
tree | ad63fdd7937f8b743f0e06330fee9522fa538747 /lib | |
parent | 8231acf6362e8902ca60ecabbafc18f42ec4534a (diff) | |
download | otp-ddf75def890d6f6a19fe46b22604ac3d8a62040a.tar.gz otp-ddf75def890d6f6a19fe46b22604ac3d8a62040a.tar.bz2 otp-ddf75def890d6f6a19fe46b22604ac3d8a62040a.zip |
hipe: fix a bug concerning typed record fields
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dialyzer/test/small_SUITE_data/src/remote_field2.erl | 17 | ||||
-rw-r--r-- | lib/hipe/cerl/erl_types.erl | 4 |
2 files changed, 20 insertions, 1 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/src/remote_field2.erl b/lib/dialyzer/test/small_SUITE_data/src/remote_field2.erl new file mode 100644 index 0000000000..35687e22ec --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/src/remote_field2.erl @@ -0,0 +1,17 @@ +-module(remote_field2). + +-export([handle_cast/2]). + +-record(state, {tcp_socket :: inet:socket()}). + +-spec handle_cast(_,_) -> + {noreply,_} | + {stop,{shutdown,connection_closed}, + #state{tcp_socket :: port()}}. +handle_cast({send, Message}, #state{tcp_socket = TCPSocket} = State) -> + case gen_tcp:send(TCPSocket, Message) of + ok -> + {noreply, State}; + {error, closed} -> + {stop, {shutdown, connection_closed}, State} + end. diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl index 06c0d10296..67661130a5 100644 --- a/lib/hipe/cerl/erl_types.erl +++ b/lib/hipe/cerl/erl_types.erl @@ -4487,7 +4487,9 @@ get_mod_record([{FieldName, DeclType}|Left1], [{FieldName, ModType}|Left2], Acc) -> ModTypeNoVars = subst_all_vars_to_any(ModType), case - contains_remote(ModTypeNoVars) orelse t_is_subtype(ModTypeNoVars, DeclType) + contains_remote(ModTypeNoVars) + orelse contains_remote(DeclType) + orelse t_is_subtype(ModTypeNoVars, DeclType) of false -> {error, FieldName}; true -> get_mod_record(Left1, Left2, [{FieldName, ModType}|Acc]) |