@@ -39,10 +39,10 @@ defmodule Module.Types.InferTest do
3939 end
4040
4141 args = [
42- dynamic ( open_map ( __struct__: atom ( [ Point ] ) ) ) ,
43- dynamic ( open_map ( __struct__: atom ( [ Point ] ) ) ) ,
44- dynamic ( atom ( [ Point ] ) ) ,
45- dynamic ( atom ( [ Point ] ) )
42+ open_map ( __struct__: atom ( [ Point ] ) ) ,
43+ open_map ( __struct__: atom ( [ Point ] ) ) ,
44+ atom ( [ Point ] ) ,
45+ atom ( [ Point ] )
4646 ]
4747
4848 assert types [ { :fun1 , 4 } ] == { :infer , nil , [ { args , atom ( [ :ok ] ) } ] }
@@ -62,7 +62,7 @@ defmodule Module.Types.InferTest do
6262 number = union ( integer ( ) , float ( ) )
6363
6464 assert types [ { :fun , 1 } ] ==
65- { :infer , nil , [ { [ dynamic ( open_map ( foo: number , bar: number ) ) ] , dynamic ( number ) } ] }
65+ { :infer , nil , [ { [ open_map ( foo: number , bar: number ) ] , dynamic ( number ) } ] }
6666 end
6767
6868 test "infer with Elixir built-in" , config do
@@ -73,7 +73,7 @@ defmodule Module.Types.InferTest do
7373
7474 assert types [ { :parse , 1 } ] ==
7575 { :infer , nil ,
76- [ { [ dynamic ( ) ] , dynamic ( union ( atom ( [ :error ] ) , tuple ( [ integer ( ) , term ( ) ] ) ) ) } ] }
76+ [ { [ term ( ) ] , dynamic ( union ( atom ( [ :error ] ) , tuple ( [ integer ( ) , term ( ) ] ) ) ) } ] }
7777 end
7878
7979 test "merges patterns" , config do
@@ -87,11 +87,11 @@ defmodule Module.Types.InferTest do
8787 end
8888
8989 assert types [ { :fun , 1 } ] ==
90- { :infer , [ dynamic ( union ( atom ( [ :ok , :error ] ) , binary ( ) ) ) ] ,
90+ { :infer , [ union ( atom ( [ :ok , :error ] ) , binary ( ) ) ] ,
9191 [
92- { [ dynamic ( atom ( [ :ok ] ) ) ] , atom ( [ :one ] ) } ,
93- { [ dynamic ( binary ( ) ) ] , atom ( [ :two , :three , :four ] ) } ,
94- { [ dynamic ( atom ( [ :error ] ) ) ] , atom ( [ :five ] ) }
92+ { [ atom ( [ :ok ] ) ] , atom ( [ :one ] ) } ,
93+ { [ binary ( ) ] , atom ( [ :two , :three , :four ] ) } ,
94+ { [ atom ( [ :error ] ) ] , atom ( [ :five ] ) }
9595 ] }
9696 end
9797
@@ -104,7 +104,7 @@ defmodule Module.Types.InferTest do
104104 end
105105
106106 assert types [ { :pub , 1 } ] ==
107- { :infer , nil , [ { [ dynamic ( atom ( [ :ok , :error ] ) ) ] , dynamic ( atom ( [ :ok , :error ] ) ) } ] }
107+ { :infer , nil , [ { [ atom ( [ :ok , :error ] ) ] , dynamic ( atom ( [ :ok , :error ] ) ) } ] }
108108
109109 assert types [ { :priv , 1 } ] == nil
110110 end
@@ -119,7 +119,7 @@ defmodule Module.Types.InferTest do
119119 end
120120
121121 assert types [ { :pub , 1 } ] ==
122- { :infer , nil , [ { [ dynamic ( atom ( [ :ok , :error ] ) ) ] , dynamic ( atom ( [ :ok , :error ] ) ) } ] }
122+ { :infer , nil , [ { [ atom ( [ :ok , :error ] ) ] , dynamic ( atom ( [ :ok , :error ] ) ) } ] }
123123 end
124124
125125 test "infers return types even with loops" , config do
@@ -128,6 +128,6 @@ defmodule Module.Types.InferTest do
128128 def pub ( x ) , do: pub ( x )
129129 end
130130
131- assert types [ { :pub , 1 } ] == { :infer , nil , [ { [ dynamic ( ) ] , dynamic ( ) } ] }
131+ assert types [ { :pub , 1 } ] == { :infer , nil , [ { [ term ( ) ] , dynamic ( ) } ] }
132132 end
133133end
0 commit comments