[erlang-patches] EEP37: Funs with names

Anthony Ramine n.oxyde@REDACTED
Mon Oct 28 00:26:54 CET 2013


With DEBUG and DEBUG_PP defined in dialyzer_dataflow:

$ bin/dialyzer --plt .dialyzer_plt lib/dialyzer/test/small_SUITE_data/src/eep37.erl
  Checking whether the PLT .dialyzer_plt is up-to-date... yes
  Proceeding with analysis…
module 'eep37' ['fact'/0, 'module_info'/0,
		'module_info'/1, 'self'/0]
  attributes ['spec' = [{{'self', 0},
			 [{'type', 5, 'fun',
			   [{'type', 5, 'product', []},
			    {'type', 5, 'fun',
			     [{'type', 5, 'product', []},
			      {'type', 5, 'fun', []}]}]}]}]]
  ('self'/0 -| [{'label', 0}]) =
      (fun () ->
	   case <> of
	     <> when 'true' ->
		 letrec
		   ('Self'/0 -| [{'label', 5}]) =
		       (fun () ->
			    let (Self -| [{'label', 6}]) =
				('Self'/0 -| [{'label', 5}])
			    in case <> of
				 <> when 'true' -> (Self -| [{'label', 6}])
				 <> when 'true' ->
				     primop
				       'match_fail'({'function_clause'})
			       end
			 -| [{'label', 13}])
		 in ('Self'/0 -| [{'label', 5}])
	     <> when 'true' ->
		 primop 'match_fail'({'function_clause'})
	   end
	-| [{'label', 19}])
  ('fact'/0 -| [{'label', 1}]) =
      (fun () ->
	   case <> of
	     <> when 'true' ->
		 letrec
		   ('Fact'/1 -| [{'label', 21}]) =
		       (fun ((_cor2 -| [{'label', 22}])) ->
			    let (Fact -| [{'label', 23}]) =
				('Fact'/1 -| [{'label', 21}])
			    in case (_cor2 -| [{'label', 22}]) of
				 (N -| [{'label', 24}])
				   when call 'erlang':'>'((N -| [{'label',
								  24}]),
							  0)
				   ->
				     let (_cor0 -| [{'label', 27}]) =
					 call 'erlang':'-'((N -| [{'label',
								   24}]),
							   1) in
				     let (_cor1 -| [{'label', 29}]) =
					 apply (Fact -| [{'label',
							  23}])((_cor0
								  -| [{'label',
								       27}]))
				     in call 'erlang':'*'((N -| [{'label',
								  24}]),
							  (_cor1
							    -| [{'label',
								 29}]))
				 0 when 'true' -> 1
				 (_cor3 -| [{'label', 35}]) when 'true' ->
				     primop 'match_fail'({'function_clause',
							  (_cor3
							    -| [{'label',
								 35}])})
			       end
			 -| [{'label', 41}])
		 in ('Fact'/1 -| [{'label', 21}])
	     <> when 'true' ->
		 primop 'match_fail'({'function_clause'})
	   end
	-| [{'label', 47}])
  ('module_info'/0 -| [{'label', 2}]) =
      (fun () ->
	   case <> of
	     <> when 'true' ->
		 call 'erlang':'get_module_info'('eep37')
	     <> when 'true' ->
		 primop 'match_fail'({'function_clause'})
	   end
	-| [{'label', 54}])
  ('module_info'/1 -| [{'label', 3}]) =
      (fun ((_cor0 -| [{'label', 55}])) ->
	   case (_cor0 -| [{'label', 55}]) of
	     (X -| [{'label', 56}]) when 'true' ->
		 call 'erlang':'get_module_info'('eep37',
						 (X -| [{'label', 56}]))
	     (_cor1 -| [{'label', 59}]) when 'true' ->
		 primop 'match_fail'({'function_clause',
				      (_cor1 -| [{'label', 59}])})
	   end
	-| [{'label', 64}])
end
DICT:[{64,{[any],unit}},
      {top,{[],none}},
      {19,{[],unit}},
      {54,{[],unit}},
      {41,{[any],unit}},
      {47,{[],unit}},
      {13,{[],unit}}]
FunType 64:{ok,{[any],unit}}
Handling fun {eep37,module_info,1}: fun((_) -> no_return())
Entering 55 :: any()
Handling 'case'
Handling var
Looking up unknown variable: {c_var,
                                 [{label,55},
                                  0,
                                  {file,
                                      "/Users/nox/src/otp/lib/dialyzer/test/small_SUITE_data/src/eep37.erl"}],
                                 cor0}
Entering 56 :: any()
Subst: storing 55 = 56
Binding pat: var to any()
Entering 56 :: any()
Binding pat: var to any()
Binding 55 to 56
Entering 56 :: any()
Handling pos guard: 'true'
Handling call
Handling literal
Handling literal
Handling literal
Handling var
Looking up unknown variable: {c_var,
                                 [{label,56},
                                  0,
                                  {file,
                                      "/Users/nox/src/otp/lib/dialyzer/test/small_SUITE_data/src/eep37.erl"}],
                                 'X'}
--------------------------------------------------------
Fun: {erlang,get_module_info,2}
Args: <'eep37',_>
NewArgsSig: <'eep37',_>
NewArgsContract: <'eep37','attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'>
NewArgsBif: <'eep37',_>
NewArgTypes: <'eep37','attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'>
RetWithoutContr: any()
RetWithoutLocal: atom() | [{atom(),_} | {atom(),byte(),integer()}]
BifRet: any()
ContrRet: atom() | [{atom(),_} | {atom(),byte(),integer()}]
SigRet: any()
NewAccRet: atom() | [{atom(),_} | {atom(),byte(),integer()}]
Entering 56 :: 'attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'
Entering 55 :: 'attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'
Entering 55 :: 'attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'
Map:
	55 :: any()
Done analyzing: {eep37,module_info,1}:fun((_) -> atom() | [{atom(),_} | {atom(),byte(),integer()}])
New Entry for {eep37,module_info,1}: fun((_) -> atom() | [{atom(),_} | {atom(),byte(),integer()}])
done adding stuff for {eep37,module_info,1}
FunType 19:{ok,{[],unit}}
Handling fun {eep37,self,0}: fun(() -> no_return())
Handling 'case'
Handling values
Binding pat: values to <>
Handling pos guard: 'true'
Handling letrec
Handling 'fun'
FunType 13:{ok,{[],unit}}
Entering 5 :: fun(() -> no_return())
Handling var
Looking up unknown variable: {c_var,[{label,5}],{'Self',0}}
Map:
Done analyzing: {eep37,self,0}:fun(() -> fun(() -> no_return()))
New Entry for {eep37,self,0}: fun(() -> fun(() -> no_return()))
{eep37,self,0}: Will try to add:[13]
done adding stuff for {eep37,self,0}
FunType 54:{ok,{[],unit}}
Handling fun {eep37,module_info,0}: fun(() -> no_return())
Handling 'case'
Handling values
Binding pat: values to <>
Handling pos guard: 'true'
Handling call
Handling literal
Handling literal
Handling literal
--------------------------------------------------------
Fun: {erlang,get_module_info,1}
Args: 'eep37'
NewArgsSig: 'eep37'
NewArgsContract: 'eep37'
NewArgsBif: 'eep37'
NewArgTypes: 'eep37'
RetWithoutContr: any()
RetWithoutLocal: [{atom(),[{atom(),_}]}]
BifRet: any()
ContrRet: [{atom(),[{atom(),_}]}]
SigRet: any()
NewAccRet: [{atom(),[{atom(),_}]}]
Map:
Done analyzing: {eep37,module_info,0}:fun(() -> [{atom(),[{atom(),_}]}])
New Entry for {eep37,module_info,0}: fun(() -> [{atom(),[any()]}])
done adding stuff for {eep37,module_info,0}
FunType 41:{ok,{[any],unit}}
Handling fun 41: fun((_) -> no_return())
Entering 22 :: any()
Handling 'let'
Subst: storing 23 = 21
Handling var
Looking up unknown variable: {c_var,[{label,21}],{'Fact',1}}
Done analyzing: 41:fun((_) -> none())
New Entry for 41: fun((_) -> none())
41: Will try to add:[41,{eep37,fact,0}]
done adding stuff for 41
FunType 47:{ok,{[],unit}}
Handling fun {eep37,fact,0}: fun(() -> no_return())
Handling 'case'
Handling values
Binding pat: values to <>
Handling pos guard: 'true'
Handling letrec
Handling 'fun'
FunType 41:{ok,{[any],none}}
Entering 21 :: fun((_) -> none())
Handling var
Looking up unknown variable: {c_var,[{label,21}],{'Fact',1}}
Map:
Done analyzing: {eep37,fact,0}:fun(() -> fun((_) -> none()))
New Entry for {eep37,fact,0}: fun(() -> fun((non_neg_integer()) -> none()))
{eep37,fact,0}: Will try to add:[41]
done adding stuff for {eep37,fact,0}
FunType 13:{ok,{[],unit}}
Handling fun 13: fun(() -> no_return())
Handling 'let'
Subst: storing 6 = 5
Handling var
Looking up unknown variable: {c_var,[{label,5}],{'Self',0}}
Done analyzing: 13:fun(() -> none())
New Entry for 13: fun(() -> none())
13: Will try to add:[{eep37,self,0},13]
done adding stuff for 13
FunType 41:{ok,{[any],none}}
Handling fun 41: fun((_) -> none())
Entering 22 :: any()
Handling 'let'
Subst: storing 23 = 21
Handling var
Looking up unknown variable: {c_var,[{label,21}],{'Fact',1}}
Done analyzing: 41:fun((_) -> none())
Fixpoint for 41: fun((_) -> none())
done adding stuff for 41
FunType 19:{ok,{[],{c,function,[{c,product,[],unknown},unit],unknown}}}
Handling fun {eep37,self,0}: fun(() -> fun(() -> no_return()))
Handling 'case'
Handling values
Binding pat: values to <>
Handling pos guard: 'true'
Handling letrec
Handling 'fun'
FunType 13:{ok,{[],none}}
Entering 5 :: fun(() -> none())
Handling var
Looking up unknown variable: {c_var,[{label,5}],{'Self',0}}
Map:
Done analyzing: {eep37,self,0}:fun(() -> fun(() -> none()))
New Entry for {eep37,self,0}: fun(() -> fun(() -> none()))
{eep37,self,0}: Will try to add:[13]
done adding stuff for {eep37,self,0}
FunType 13:{ok,{[],none}}
Handling fun 13: fun(() -> none())
Handling 'let'
Subst: storing 6 = 5
Handling var
Looking up unknown variable: {c_var,[{label,5}],{'Self',0}}
Done analyzing: 13:fun(() -> none())
Fixpoint for 13: fun(() -> none())
done adding stuff for 13
module 'eep37' ['fact'/0, 'module_info'/0,
		'module_info'/1, 'self'/0]
  attributes ['spec' = [{{'self', 0},
			 [{'type', 5, 'fun',
			   [{'type', 5, 'product', []},
			    {'type', 5, 'fun',
			     [{'type', 5, 'product', []},
			      {'type', 5, 'fun', []}]}]}]}]]
  ('self'/0 -| [{'label', 0}]) =
      (fun () ->
	   case <> of
	     <> when 'true' ->
		 letrec
		   ('Self'/0 -| [{'label', 5}]) =
		       (fun () ->
			    let (Self -| [{'label', 6}]) =
				('Self'/0 -| [{'label', 5}])
			    in case <> of
				 <> when 'true' -> (Self -| [{'label', 6}])
				 <> when 'true' ->
				     primop
				       'match_fail'({'function_clause'})
			       end
			 -| [{'label', 13}])
		 in ('Self'/0 -| [{'label', 5}])
	     <> when 'true' ->
		 primop 'match_fail'({'function_clause'})
	   end
	-| [{'label', 19}])
  ('fact'/0 -| [{'label', 1}]) =
      (fun () ->
	   case <> of
	     <> when 'true' ->
		 letrec
		   ('Fact'/1 -| [{'label', 21}]) =
		       (fun ((_cor2 -| [{'label', 22}])) ->
			    let (Fact -| [{'label', 23}]) =
				('Fact'/1 -| [{'label', 21}])
			    in case (_cor2 -| [{'label', 22}]) of
				 (N -| [{'label', 24}])
				   when call 'erlang':'>'((N -| [{'label',
								  24}]),
							  0)
				   ->
				     let (_cor0 -| [{'label', 27}]) =
					 call 'erlang':'-'((N -| [{'label',
								   24}]),
							   1) in
				     let (_cor1 -| [{'label', 29}]) =
					 apply (Fact -| [{'label',
							  23}])((_cor0
								  -| [{'label',
								       27}]))
				     in call 'erlang':'*'((N -| [{'label',
								  24}]),
							  (_cor1
							    -| [{'label',
								 29}]))
				 0 when 'true' -> 1
				 (_cor3 -| [{'label', 35}]) when 'true' ->
				     primop 'match_fail'({'function_clause',
							  (_cor3
							    -| [{'label',
								 35}])})
			       end
			 -| [{'label', 41}])
		 in ('Fact'/1 -| [{'label', 21}])
	     <> when 'true' ->
		 primop 'match_fail'({'function_clause'})
	   end
	-| [{'label', 47}])
  ('module_info'/0 -| [{'label', 2}]) =
      (fun () ->
	   case <> of
	     <> when 'true' ->
		 call 'erlang':'get_module_info'('eep37')
	     <> when 'true' ->
		 primop 'match_fail'({'function_clause'})
	   end
	-| [{'label', 54}])
  ('module_info'/1 -| [{'label', 3}]) =
      (fun ((_cor0 -| [{'label', 55}])) ->
	   case (_cor0 -| [{'label', 55}]) of
	     (X -| [{'label', 56}]) when 'true' ->
		 call 'erlang':'get_module_info'('eep37',
						 (X -| [{'label', 56}]))
	     (_cor1 -| [{'label', 59}]) when 'true' ->
		 primop 'match_fail'({'function_clause',
				      (_cor1 -| [{'label', 59}])})
	   end
	-| [{'label', 64}])
end
DICT:[{64,{[any],unit}},
      {top,{[],none}},
      {19,{[],unit}},
      {54,{[],unit}},
      {41,{[any],unit}},
      {47,{[],unit}},
      {13,{[],unit}}]
FunType 64:{ok,{[any],unit}}
Handling fun {eep37,module_info,1}: fun((_) -> no_return())
Entering 55 :: any()
Handling 'case'
Handling var
Looking up unknown variable: {c_var,
                                 [{label,55},
                                  0,
                                  {file,
                                      "/Users/nox/src/otp/lib/dialyzer/test/small_SUITE_data/src/eep37.erl"}],
                                 cor0}
Entering 56 :: any()
Subst: storing 55 = 56
Binding pat: var to any()
Entering 56 :: any()
Binding pat: var to any()
Binding 55 to 56
Entering 56 :: any()
Handling pos guard: 'true'
Handling call
Handling literal
Handling literal
Handling literal
Handling var
Looking up unknown variable: {c_var,
                                 [{label,56},
                                  0,
                                  {file,
                                      "/Users/nox/src/otp/lib/dialyzer/test/small_SUITE_data/src/eep37.erl"}],
                                 'X'}
--------------------------------------------------------
Fun: {erlang,get_module_info,2}
Args: <'eep37',_>
NewArgsSig: <'eep37',_>
NewArgsContract: <'eep37','attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'>
NewArgsBif: <'eep37',_>
NewArgTypes: <'eep37','attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'>
RetWithoutContr: any()
RetWithoutLocal: atom() | [{atom(),_} | {atom(),byte(),integer()}]
BifRet: any()
ContrRet: atom() | [{atom(),_} | {atom(),byte(),integer()}]
SigRet: any()
NewAccRet: atom() | [{atom(),_} | {atom(),byte(),integer()}]
Entering 56 :: 'attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'
Entering 55 :: 'attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'
Entering 55 :: 'attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'
Map:
	55 :: any()
Done analyzing: {eep37,module_info,1}:fun((_) -> atom() | [{atom(),_} | {atom(),byte(),integer()}])
New Entry for {eep37,module_info,1}: fun((_) -> atom() | [{atom(),_} | {atom(),byte(),integer()}])
done adding stuff for {eep37,module_info,1}
FunType 19:{ok,{[],unit}}
Handling fun {eep37,self,0}: fun(() -> no_return())
Handling 'case'
Handling values
Binding pat: values to <>
Handling pos guard: 'true'
Handling letrec
Handling 'fun'
FunType 13:{ok,{[],unit}}
Entering 5 :: fun(() -> no_return())
Handling var
Looking up unknown variable: {c_var,[{label,5}],{'Self',0}}
Map:
Done analyzing: {eep37,self,0}:fun(() -> fun(() -> no_return()))
New Entry for {eep37,self,0}: fun(() -> fun(() -> none()))
{eep37,self,0}: Will try to add:[13]
done adding stuff for {eep37,self,0}
FunType 54:{ok,{[],unit}}
Handling fun {eep37,module_info,0}: fun(() -> no_return())
Handling 'case'
Handling values
Binding pat: values to <>
Handling pos guard: 'true'
Handling call
Handling literal
Handling literal
Handling literal
--------------------------------------------------------
Fun: {erlang,get_module_info,1}
Args: 'eep37'
NewArgsSig: 'eep37'
NewArgsContract: 'eep37'
NewArgsBif: 'eep37'
NewArgTypes: 'eep37'
RetWithoutContr: any()
RetWithoutLocal: [{atom(),[{atom(),_}]}]
BifRet: any()
ContrRet: [{atom(),[{atom(),_}]}]
SigRet: any()
NewAccRet: [{atom(),[{atom(),_}]}]
Map:
Done analyzing: {eep37,module_info,0}:fun(() -> [{atom(),[{atom(),_}]}])
New Entry for {eep37,module_info,0}: fun(() -> [{atom(),[any()]}])
done adding stuff for {eep37,module_info,0}
FunType 41:{ok,{[any],unit}}
Handling fun 41: fun((_) -> no_return())
Entering 22 :: any()
Handling 'let'
Subst: storing 23 = 21
Handling var
Looking up unknown variable: {c_var,[{label,21}],{'Fact',1}}
Done analyzing: 41:fun((_) -> none())
New Entry for 41: fun((_) -> none())
41: Will try to add:[41,{eep37,fact,0}]
done adding stuff for 41
FunType 47:{ok,{[],unit}}
Handling fun {eep37,fact,0}: fun(() -> no_return())
Handling 'case'
Handling values
Binding pat: values to <>
Handling pos guard: 'true'
Handling letrec
Handling 'fun'
FunType 41:{ok,{[any],none}}
Entering 21 :: fun((_) -> none())
Handling var
Looking up unknown variable: {c_var,[{label,21}],{'Fact',1}}
Map:
Done analyzing: {eep37,fact,0}:fun(() -> fun((_) -> none()))
New Entry for {eep37,fact,0}: fun(() -> fun((0) -> none()))
{eep37,fact,0}: Will try to add:[41]
done adding stuff for {eep37,fact,0}
FunType 13:{ok,{[],unit}}
Handling fun 13: fun(() -> no_return())
Handling 'let'
Subst: storing 6 = 5
Handling var
Looking up unknown variable: {c_var,[{label,5}],{'Self',0}}
Done analyzing: 13:fun(() -> none())
New Entry for 13: fun(() -> none())
13: Will try to add:[{eep37,self,0},13]
done adding stuff for 13
FunType 41:{ok,{[any],none}}
Handling fun 41: fun((_) -> none())
Entering 22 :: any()
Handling 'let'
Subst: storing 23 = 21
Handling var
Looking up unknown variable: {c_var,[{label,21}],{'Fact',1}}
Done analyzing: 41:fun((_) -> none())
Fixpoint for 41: fun((_) -> none())
done adding stuff for 41
FunType 19:{ok,{[],{c,function,[{c,product,[],unknown},none],unknown}}}
Handling fun {eep37,self,0}: fun(() -> fun(() -> none()))
Handling 'case'
Handling values
Binding pat: values to <>
Handling pos guard: 'true'
Handling letrec
Handling 'fun'
FunType 13:{ok,{[],none}}
Entering 5 :: fun(() -> none())
Handling var
Looking up unknown variable: {c_var,[{label,5}],{'Self',0}}
Map:
Done analyzing: {eep37,self,0}:fun(() -> fun(() -> none()))
Fixpoint for {eep37,self,0}: fun(() -> fun(() -> none()))
done adding stuff for {eep37,self,0}
FunType 13:{ok,{[],none}}
Handling fun 13: fun(() -> none())
Handling 'let'
Subst: storing 6 = 5
Handling var
Looking up unknown variable: {c_var,[{label,5}],{'Self',0}}
Done analyzing: 13:fun(() -> none())
Fixpoint for 13: fun(() -> none())
done adding stuff for 13
module 'eep37' ['fact'/0, 'module_info'/0,
		'module_info'/1, 'self'/0]
  attributes ['spec' = [{{'self', 0},
			 [{'type', 5, 'fun',
			   [{'type', 5, 'product', []},
			    {'type', 5, 'fun',
			     [{'type', 5, 'product', []},
			      {'type', 5, 'fun', []}]}]}]}]]
  ('self'/0 -| [{'label', 0}]) =
      (fun () ->
	   case <> of
	     <> when 'true' ->
		 letrec
		   ('Self'/0 -| [{'label', 5}]) =
		       (fun () ->
			    let (Self -| [{'label', 6}]) =
				('Self'/0 -| [{'label', 5}])
			    in case <> of
				 <> when 'true' -> (Self -| [{'label', 6}])
				 <> when 'true' ->
				     primop
				       'match_fail'({'function_clause'})
			       end
			 -| [{'label', 13}])
		 in ('Self'/0 -| [{'label', 5}])
	     <> when 'true' ->
		 primop 'match_fail'({'function_clause'})
	   end
	-| [{'label', 19}])
  ('fact'/0 -| [{'label', 1}]) =
      (fun () ->
	   case <> of
	     <> when 'true' ->
		 letrec
		   ('Fact'/1 -| [{'label', 21}]) =
		       (fun ((_cor2 -| [{'label', 22}])) ->
			    let (Fact -| [{'label', 23}]) =
				('Fact'/1 -| [{'label', 21}])
			    in case (_cor2 -| [{'label', 22}]) of
				 (N -| [{'label', 24}])
				   when call 'erlang':'>'((N -| [{'label',
								  24}]),
							  0)
				   ->
				     let (_cor0 -| [{'label', 27}]) =
					 call 'erlang':'-'((N -| [{'label',
								   24}]),
							   1) in
				     let (_cor1 -| [{'label', 29}]) =
					 apply (Fact -| [{'label',
							  23}])((_cor0
								  -| [{'label',
								       27}]))
				     in call 'erlang':'*'((N -| [{'label',
								  24}]),
							  (_cor1
							    -| [{'label',
								 29}]))
				 0 when 'true' -> 1
				 (_cor3 -| [{'label', 35}]) when 'true' ->
				     primop 'match_fail'({'function_clause',
							  (_cor3
							    -| [{'label',
								 35}])})
			       end
			 -| [{'label', 41}])
		 in ('Fact'/1 -| [{'label', 21}])
	     <> when 'true' ->
		 primop 'match_fail'({'function_clause'})
	   end
	-| [{'label', 47}])
  ('module_info'/0 -| [{'label', 2}]) =
      (fun () ->
	   case <> of
	     <> when 'true' ->
		 call 'erlang':'get_module_info'('eep37')
	     <> when 'true' ->
		 primop 'match_fail'({'function_clause'})
	   end
	-| [{'label', 54}])
  ('module_info'/1 -| [{'label', 3}]) =
      (fun ((_cor0 -| [{'label', 55}])) ->
	   case (_cor0 -| [{'label', 55}]) of
	     (X -| [{'label', 56}]) when 'true' ->
		 call 'erlang':'get_module_info'('eep37',
						 (X -| [{'label', 56}]))
	     (_cor1 -| [{'label', 59}]) when 'true' ->
		 primop 'match_fail'({'function_clause',
				      (_cor1 -| [{'label', 59}])})
	   end
	-| [{'label', 64}])
end
DICT:[{64,{[any],unit}},
      {top,{[],none}},
      {19,{[],unit}},
      {54,{[],unit}},
      {41,{[any],unit}},
      {47,{[],unit}},
      {13,{[],unit}}]
FunType 64:{ok,{[any],unit}}
Handling fun {eep37,module_info,1}: fun((_) -> no_return())
Entering 55 :: any()
Handling 'case'
Handling var
Looking up unknown variable: {c_var,
                                 [{label,55},
                                  0,
                                  {file,
                                      "/Users/nox/src/otp/lib/dialyzer/test/small_SUITE_data/src/eep37.erl"}],
                                 cor0}
Entering 56 :: any()
Subst: storing 55 = 56
Binding pat: var to any()
Entering 56 :: any()
Binding pat: var to any()
Binding 55 to 56
Entering 56 :: any()
Handling pos guard: 'true'
Handling call
Handling literal
Handling literal
Handling literal
Handling var
Looking up unknown variable: {c_var,
                                 [{label,56},
                                  0,
                                  {file,
                                      "/Users/nox/src/otp/lib/dialyzer/test/small_SUITE_data/src/eep37.erl"}],
                                 'X'}
--------------------------------------------------------
Fun: {erlang,get_module_info,2}
Args: <'eep37',_>
NewArgsSig: <'eep37',_>
NewArgsContract: <'eep37','attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'>
NewArgsBif: <'eep37',_>
NewArgTypes: <'eep37','attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'>
RetWithoutContr: any()
RetWithoutLocal: atom() | [{atom(),_} | {atom(),byte(),integer()}]
BifRet: any()
ContrRet: atom() | [{atom(),_} | {atom(),byte(),integer()}]
SigRet: any()
NewAccRet: atom() | [{atom(),_} | {atom(),byte(),integer()}]
Entering 56 :: 'attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'
Entering 55 :: 'attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'
Entering 55 :: 'attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'
Map:
	55 :: any()
Done analyzing: {eep37,module_info,1}:fun((_) -> atom() | [{atom(),_} | {atom(),byte(),integer()}])
New Entry for {eep37,module_info,1}: fun((_) -> atom() | [{atom(),_} | {atom(),byte(),integer()}])
done adding stuff for {eep37,module_info,1}
FunType 19:{ok,{[],unit}}
Handling fun {eep37,self,0}: fun(() -> no_return())
Handling 'case'
Handling values
Binding pat: values to <>
Handling pos guard: 'true'
Handling letrec
Handling 'fun'
FunType 13:{ok,{[],unit}}
Entering 5 :: fun(() -> no_return())
Handling var
Looking up unknown variable: {c_var,[{label,5}],{'Self',0}}
Map:
Done analyzing: {eep37,self,0}:fun(() -> fun(() -> no_return()))
New Entry for {eep37,self,0}: fun(() -> fun(() -> none()))
{eep37,self,0}: Will try to add:[13]
done adding stuff for {eep37,self,0}
FunType 54:{ok,{[],unit}}
Handling fun {eep37,module_info,0}: fun(() -> no_return())
Handling 'case'
Handling values
Binding pat: values to <>
Handling pos guard: 'true'
Handling call
Handling literal
Handling literal
Handling literal
--------------------------------------------------------
Fun: {erlang,get_module_info,1}
Args: 'eep37'
NewArgsSig: 'eep37'
NewArgsContract: 'eep37'
NewArgsBif: 'eep37'
NewArgTypes: 'eep37'
RetWithoutContr: any()
RetWithoutLocal: [{atom(),[{atom(),_}]}]
BifRet: any()
ContrRet: [{atom(),[{atom(),_}]}]
SigRet: any()
NewAccRet: [{atom(),[{atom(),_}]}]
Map:
Done analyzing: {eep37,module_info,0}:fun(() -> [{atom(),[{atom(),_}]}])
New Entry for {eep37,module_info,0}: fun(() -> [{atom(),[any()]}])
done adding stuff for {eep37,module_info,0}
FunType 41:{ok,{[any],unit}}
Handling fun 41: fun((_) -> no_return())
Entering 22 :: any()
Handling 'let'
Subst: storing 23 = 21
Handling var
Looking up unknown variable: {c_var,[{label,21}],{'Fact',1}}
Done analyzing: 41:fun((_) -> none())
New Entry for 41: fun((_) -> none())
41: Will try to add:[41,{eep37,fact,0}]
done adding stuff for 41
FunType 47:{ok,{[],unit}}
Handling fun {eep37,fact,0}: fun(() -> no_return())
Handling 'case'
Handling values
Binding pat: values to <>
Handling pos guard: 'true'
Handling letrec
Handling 'fun'
FunType 41:{ok,{[any],none}}
Entering 21 :: fun((_) -> none())
Handling var
Looking up unknown variable: {c_var,[{label,21}],{'Fact',1}}
Map:
Done analyzing: {eep37,fact,0}:fun(() -> fun((_) -> none()))
New Entry for {eep37,fact,0}: fun(() -> fun((0) -> none()))
{eep37,fact,0}: Will try to add:[41]
done adding stuff for {eep37,fact,0}
FunType 13:{ok,{[],unit}}
Handling fun 13: fun(() -> no_return())
Handling 'let'
Subst: storing 6 = 5
Handling var
Looking up unknown variable: {c_var,[{label,5}],{'Self',0}}
Done analyzing: 13:fun(() -> none())
New Entry for 13: fun(() -> none())
13: Will try to add:[{eep37,self,0},13]
done adding stuff for 13
FunType 41:{ok,{[any],none}}
Handling fun 41: fun((_) -> none())
Entering 22 :: any()
Handling 'let'
Subst: storing 23 = 21
Handling var
Looking up unknown variable: {c_var,[{label,21}],{'Fact',1}}
Done analyzing: 41:fun((_) -> none())
Fixpoint for 41: fun((_) -> none())
done adding stuff for 41
FunType 19:{ok,{[],{c,function,[{c,product,[],unknown},none],unknown}}}
Handling fun {eep37,self,0}: fun(() -> fun(() -> none()))
Handling 'case'
Handling values
Binding pat: values to <>
Handling pos guard: 'true'
Handling letrec
Handling 'fun'
FunType 13:{ok,{[],none}}
Entering 5 :: fun(() -> none())
Handling var
Looking up unknown variable: {c_var,[{label,5}],{'Self',0}}
Map:
Done analyzing: {eep37,self,0}:fun(() -> fun(() -> none()))
Fixpoint for {eep37,self,0}: fun(() -> fun(() -> none()))
done adding stuff for {eep37,self,0}
FunType 13:{ok,{[],none}}
Handling fun 13: fun(() -> none())
Handling 'let'
Subst: storing 6 = 5
Handling var
Looking up unknown variable: {c_var,[{label,5}],{'Self',0}}
Done analyzing: 13:fun(() -> none())
Fixpoint for 13: fun(() -> none())
done adding stuff for 13
==========
Starting warning pass
==========
FunType top:{ok,{[],none}}
Handling fun top: fun(() -> none())
Handling module
Handling letrec
Handling 'fun'
FunType 19:{ok,{[],{c,function,[{c,product,[],unknown},none],unknown}}}
Entering 0 :: fun(() -> fun(() -> none()))
Handling 'fun'
FunType 47:{ok,{[],
                {c,function,
                   [{c,product,[{c,number,{int_set,[0]},integer}],unknown},
                    none],
                   unknown}}}
Entering 1 :: fun(() -> fun((0) -> none()))
Handling 'fun'
FunType 54:{ok,{[],
                {c,list,
                   [{c,tuple,
                       [{c,atom,any,unknown},
                        {c,list,[any,{c,nil,[],unknown}],unknown}],
                       {2,any}},
                    {c,nil,[],unknown}],
                   unknown}}}
Entering 2 :: fun(() -> [{atom(),[any()]}])
Handling 'fun'
FunType 64:{ok,{[any],
                {c,union,
                   [{c,atom,any,unknown},
                    none,none,none,
                    {c,list,
                       [{c,tuple_set,
                           [{2,[{c,tuple,[{c,atom,any,unknown},any],{2,any}}]},
                            {3,
                             [{c,tuple,
                                 [{c,atom,any,unknown},
                                  {c,number,{int_rng,0,255},integer},
                                  {c,number,any,integer}],
                                 {3,any}}]}],
                           unknown},
                        {c,nil,[],unknown}],
                       unknown},
                    none,none,none,none,none],
                   unknown}}}
Entering 3 :: fun((_) -> atom() | [{atom(),_} | {atom(),byte(),integer()}])
Handling literal
FunType 19:{ok,{[],{c,function,[{c,product,[],unknown},none],unknown}}}
FunType 47:{ok,{[],
                {c,function,
                   [{c,product,[{c,number,{int_set,[0]},integer}],unknown},
                    none],
                   unknown}}}
FunType 54:{ok,{[],
                {c,list,
                   [{c,tuple,
                       [{c,atom,any,unknown},
                        {c,list,[any,{c,nil,[],unknown}],unknown}],
                       {2,any}},
                    {c,nil,[],unknown}],
                   unknown}}}
FunType 64:{ok,{[any],
                {c,union,
                   [{c,atom,any,unknown},
                    none,none,none,
                    {c,list,
                       [{c,tuple_set,
                           [{2,[{c,tuple,[{c,atom,any,unknown},any],{2,any}}]},
                            {3,
                             [{c,tuple,
                                 [{c,atom,any,unknown},
                                  {c,number,{int_rng,0,255},integer},
                                  {c,number,any,integer}],
                                 {3,any}}]}],
                           unknown},
                        {c,nil,[],unknown}],
                       unknown},
                    none,none,none,none,none],
                   unknown}}}
Entering 0 :: fun(() -> fun(() -> none()))
Entering 1 :: fun(() -> fun((0) -> none()))
Entering 2 :: fun(() -> [{atom(),[any()]}])
Entering 3 :: fun((_) -> atom() | [{atom(),_} | {atom(),byte(),integer()}])
Done analyzing: top:fun(() -> any())
New Entry for top: fun(() -> any())
done adding stuff for top
FunType 64:{ok,{[any],
                {c,union,
                   [{c,atom,any,unknown},
                    none,none,none,
                    {c,list,
                       [{c,tuple_set,
                           [{2,[{c,tuple,[{c,atom,any,unknown},any],{2,any}}]},
                            {3,
                             [{c,tuple,
                                 [{c,atom,any,unknown},
                                  {c,number,{int_rng,0,255},integer},
                                  {c,number,any,integer}],
                                 {3,any}}]}],
                           unknown},
                        {c,nil,[],unknown}],
                       unknown},
                    none,none,none,none,none],
                   unknown}}}
Handling fun {eep37,module_info,1}: fun((_) -> atom() | [{atom(),_} | {atom(),byte(),integer()}])
Entering 55 :: any()
Handling 'case'
Handling var
Looking up unknown variable: {c_var,
                                 [{label,55},
                                  0,
                                  {file,
                                      "/Users/nox/src/otp/lib/dialyzer/test/small_SUITE_data/src/eep37.erl"}],
                                 cor0}
Entering 56 :: any()
Subst: storing 55 = 56
Binding pat: var to any()
Entering 56 :: any()
Binding pat: var to any()
Binding 55 to 56
Entering 56 :: any()
Handling pos guard: 'true'
Handling call
Handling literal
Handling literal
Handling literal
Handling var
Looking up unknown variable: {c_var,
                                 [{label,56},
                                  0,
                                  {file,
                                      "/Users/nox/src/otp/lib/dialyzer/test/small_SUITE_data/src/eep37.erl"}],
                                 'X'}
--------------------------------------------------------
Fun: {erlang,get_module_info,2}
Args: <'eep37',_>
NewArgsSig: <'eep37',_>
NewArgsContract: <'eep37','attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'>
NewArgsBif: <'eep37',_>
NewArgTypes: <'eep37','attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'>
RetWithoutContr: any()
RetWithoutLocal: atom() | [{atom(),_} | {atom(),byte(),integer()}]
BifRet: any()
ContrRet: atom() | [{atom(),_} | {atom(),byte(),integer()}]
SigRet: any()
NewAccRet: atom() | [{atom(),_} | {atom(),byte(),integer()}]
Entering 56 :: 'attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'
Entering 55 :: 'attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'
Entering 55 :: 'attributes' | 'compile' | 'exports' | 'functions' | 'imports' | 'module' | 'native_addresses'
Map:
	55 :: any()
Done analyzing: {eep37,module_info,1}:fun((_) -> atom() | [{atom(),_} | {atom(),byte(),integer()}])
Fixpoint for {eep37,module_info,1}: fun((_) -> atom() | [{atom(),_} | {atom(),byte(),integer()}])
done adding stuff for {eep37,module_info,1}
FunType 19:{ok,{[],{c,function,[{c,product,[],unknown},none],unknown}}}
Handling fun {eep37,self,0}: fun(() -> fun(() -> none()))
Handling 'case'
Handling values
Binding pat: values to <>
Handling pos guard: 'true'
Handling letrec
Handling 'fun'
FunType 13:{ok,{[],none}}
Entering 5 :: fun(() -> none())
Handling var
Looking up unknown variable: {c_var,[{label,5}],{'Self',0}}
Map:
Done analyzing: {eep37,self,0}:fun(() -> fun(() -> none()))
Fixpoint for {eep37,self,0}: fun(() -> fun(() -> none()))
done adding stuff for {eep37,self,0}
FunType 54:{ok,{[],
                {c,list,
                   [{c,tuple,
                       [{c,atom,any,unknown},
                        {c,list,[any,{c,nil,[],unknown}],unknown}],
                       {2,any}},
                    {c,nil,[],unknown}],
                   unknown}}}
Handling fun {eep37,module_info,0}: fun(() -> [{atom(),[any()]}])
Handling 'case'
Handling values
Binding pat: values to <>
Handling pos guard: 'true'
Handling call
Handling literal
Handling literal
Handling literal
--------------------------------------------------------
Fun: {erlang,get_module_info,1}
Args: 'eep37'
NewArgsSig: 'eep37'
NewArgsContract: 'eep37'
NewArgsBif: 'eep37'
NewArgTypes: 'eep37'
RetWithoutContr: any()
RetWithoutLocal: [{atom(),[{atom(),_}]}]
BifRet: any()
ContrRet: [{atom(),[{atom(),_}]}]
SigRet: any()
NewAccRet: [{atom(),[{atom(),_}]}]
Map:
Done analyzing: {eep37,module_info,0}:fun(() -> [{atom(),[{atom(),_}]}])
Fixpoint for {eep37,module_info,0}: fun(() -> [{atom(),[any()]}])
done adding stuff for {eep37,module_info,0}
FunType 41:{ok,{[any],none}}
Handling fun 41: fun((_) -> none())
Entering 22 :: any()
Handling 'let'
Subst: storing 23 = 21
Handling var
Looking up unknown variable: {c_var,[{label,21}],{'Fact',1}}
Done analyzing: 41:fun((_) -> none())
Fixpoint for 41: fun((_) -> none())
done adding stuff for 41
FunType 47:{ok,{[],
                {c,function,
                   [{c,product,[{c,number,{int_set,[0]},integer}],unknown},
                    none],
                   unknown}}}
Handling fun {eep37,fact,0}: fun(() -> fun((0) -> none()))
Handling 'case'
Handling values
Binding pat: values to <>
Handling pos guard: 'true'
Handling letrec
Handling 'fun'
FunType 41:{ok,{[any],none}}
Entering 21 :: fun((_) -> none())
Handling var
Looking up unknown variable: {c_var,[{label,21}],{'Fact',1}}
Map:
Done analyzing: {eep37,fact,0}:fun(() -> fun((_) -> none()))
Fixpoint for {eep37,fact,0}: fun(() -> fun((0) -> none()))
done adding stuff for {eep37,fact,0}
FunType 13:{ok,{[],none}}
Handling fun 13: fun(() -> none())
Handling 'let'
Subst: storing 6 = 5
Handling var
Looking up unknown variable: {c_var,[{label,5}],{'Self',0}}
Done analyzing: 13:fun(() -> none())
Fixpoint for 13: fun(() -> none())
done adding stuff for 13

eep37.erl:7: The created fun has no local return
eep37.erl:11: The created fun has no local return
 done in 0m0.46s
done (warnings were emitted)


Regards,

-- 
Anthony Ramine

Le 27 oct. 2013 à 21:29, Anthony Ramine <n.oxyde@REDACTED> a écrit :

> I’ve added tests for named funs in every place you asked for except syntax_tools.
> 
> The Dialyzer test doesn’t pass and I haven’t found a fix for it yet, Cc’ing Kostis.
> 
> If I give "fact() -> fun Fact(N) when N > 0 -> N * Fact(N - 1); Fact(0) -> 1 end" to typer, the following spec is computed:
> 
> -spec fact() -> fun((0) -> none()).
> 
> Please refetch.
> 
> -- 
> Anthony Ramine
> 
> Le 23 oct. 2013 à 15:04, Björn Gustavsson <bgustavsson@REDACTED> a écrit :
> 
>> The new test cases are insufficient for an extension of the language. Each
>> application that have updates should have test cases to ensure that new or
>> updated code is covered. The following applications should have test cases
>> for named funs: compiler, tools (xref and cover), stdlib (qlc, erl_eval, ms_transform),
>> dialyzer, debugger, and syntax_tools.
>> 
> 




More information about the erlang-patches mailing list