Skip to content

Commit

Permalink
dialyzer: fix crash with nominal types
Browse files Browse the repository at this point in the history
Fix #9131
  • Loading branch information
lucioleKi committed Dec 2, 2024
1 parent 709aed9 commit 511e33b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/dialyzer/src/erl_types.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2148,6 +2148,8 @@ t_sup_aux(?nominal(LHS_Name, ?nominal(LHS_InnerName, _)=LHS_Inner)=LHS,
?nominal(RHS_Name, Sup);
?nominal(RHS_InnerName = LHS_Name, _)=Sup ->
?nominal(LHS_Name, Sup);
?nominal(_,_)=Sup ->
Sup;
?nominal_set(_, ?none) when LHS_Name < RHS_Name ->
?nominal_set([LHS, RHS], ?none);
?nominal_set(_, ?none) ->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2024. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing, software
%% distributed under the License is distributed on an "AS IS" BASIS,
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
%%
%% %CopyrightEnd%

-module(nested_nominal).
-nominal i1() :: i2() | integer().
-opaque i2() :: i3().
-nominal i3() :: {i1() | i2()}.
-export_type([i2/0]).

%% Expected: should not crash

0 comments on commit 511e33b

Please sign in to comment.