mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 13:32:45 +00:00 
			
		
		
		
	AK+Everywhere: Disallow constructing Functions from incompatible types
Previously, AK::Function would accept _any_ callable type, and try to call it when called, first with the given set of arguments, then with zero arguments, and if all of those failed, it would simply not call the function and **return a value-constructed Out type**. This lead to many, many, many hard to debug situations when someone forgot a `const` in their lambda argument types, and many cases of people taking zero arguments in their lambdas to ignore them. This commit reworks the Function interface to not include any such surprising behaviour, if your function instance is not callable with the declared argument set of the Function, it can simply not be assigned to that Function instance, end of story.
This commit is contained in:
		
							parent
							
								
									104dc93220
								
							
						
					
					
						commit
						51c2c69357
					
				
					 28 changed files with 99 additions and 92 deletions
				
			
		|  | @ -62,7 +62,7 @@ NewProjectDialog::NewProjectDialog(GUI::Window* parent) | |||
|     m_icon_view->on_selection_change = [&]() { | ||||
|         update_dialog(); | ||||
|     }; | ||||
|     m_icon_view->on_activation = [&]() { | ||||
|     m_icon_view->on_activation = [&](auto&) { | ||||
|         if (m_input_valid) | ||||
|             do_create_project(); | ||||
|     }; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ali Mohammad Pur
						Ali Mohammad Pur