2525 smoke /1 ,
2626 smoke_incremental_plt /1 ,
2727 gh_6296_no_spec_flag_does_not_break_records /1 ,
28- contract_violation /1 ]).
28+ contract_violation /1 ,
29+ typer_multiple_fun_in_same_line /1 ]).
2930
3031-include_lib (" common_test/include/ct.hrl" ).
3132
@@ -35,7 +36,8 @@ all() ->
3536 [smoke ,
3637 smoke_incremental_plt ,
3738 gh_6296_no_spec_flag_does_not_break_records ,
38- contract_violation ].
39+ contract_violation ,
40+ typer_multiple_fun_in_same_line ].
3941
4042smoke (Config ) ->
4143 OutDir = proplists :get_value (priv_dir , Config ),
@@ -92,6 +94,31 @@ gh_6296_no_spec_flag_does_not_break_records(Config) ->
9294 run (Config , Args , Src , Res ),
9395 ok .
9496
97+ typer_multiple_fun_in_same_line (Config ) ->
98+ Code = <<" -module(typer_multiple_fun).
99+ f() -> ok. g() -> ok." >>,
100+ PrivDir = proplists :get_value (priv_dir , Config ),
101+ Src = filename :join (PrivDir , " typer_multiple_fun.erl" ),
102+ ok = file :write_file (Src , Code ),
103+ {ok , Beam } = compile (Config , Code , typer_multiple_fun , []),
104+ Plt = PrivDir ++ " dialyzer_iplt" ,
105+ _ = dialyzer :run ([{analysis_type , incremental },
106+ {files , [Beam ]},
107+ {apps , [stdlib , kernel , erts ]},
108+ {from , byte_code },
109+ {init_plt , Plt },
110+ {output_plt , Plt }]),
111+ Args = io_lib :format (" --no_spec --show --plt ~ts " , [Plt ]),
112+ Res = [" ^$" ,
113+ " ^%% File:" ,
114+ " ^%% ----" ,
115+ " ^-spec f" ,
116+ " ^-spec g" ,
117+ " ^_OK_" ],
118+
119+ run (Config , Args , Src , Res ),
120+ ok .
121+
95122smoke_incremental_plt (Config ) ->
96123 Code = <<" -module(typer_test_module).
97124 -compile([export_all,nowarn_export_all]).
0 commit comments