Peregrine icon indicating copy to clipboard operation
Peregrine copied to clipboard

C++ compiler giving errors instead of peregrine handling function arguments correctly.

Open InsaneMiner opened this issue 2 years ago • 4 comments

when i do not give a function all the arguments needed, the c++ compiler will give me errors. Peregrine should check this and give an error not the c++ compiler. code

def function(arg)->int:
	printf("arg: %d\n", arg)
	return 1


def main()->int:
	function()
	return 0

error

temp.cc: In function ‘int main()’:
temp.cc:19:92: error: no matching function for call to ‘____P____P________home____dev____projects____Peregrine____builddir____main___pefunction(____P____exception_handler*&)’
   19 |     ____P____P________home____dev____projects____Peregrine____builddir____main___pefunction(____Pexception_handlers);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
temp.cc:13:9: note: candidate: ‘template<class auto:3> int64_t ____P____P________home____dev____projects____Peregrine____builddir____main___pefunction(auto:3, ____P____exception_handler*)’
   13 | int64_t ____P____P________home____dev____projects____Peregrine____builddir____main___pefunction(auto ____P____P____arg,____P____exception_handler* ____Pexception_handlers)  noexcept {
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
temp.cc:13:9: note:   template argument deduction/substitution failed:
temp.cc:19:92: note:   candidate expects 2 arguments, 1 provided
   19 |     ____P____P________home____dev____projects____Peregrine____builddir____main___pefunction(____Pexception_handlers);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

InsaneMiner avatar Mar 13 '22 23:03 InsaneMiner

@InsaneMiner Yes you are correct but the typechecker is highly wip so it is disabled by default

SaptakBhoumik avatar Mar 14 '22 07:03 SaptakBhoumik

@SaptakBhoumik Ok

InsaneMiner avatar Mar 14 '22 21:03 InsaneMiner

I will keep this open until it has been fixed, is that alright?

InsaneMiner avatar Mar 14 '22 21:03 InsaneMiner

@InsaneMiner yes you can keep it open

SaptakBhoumik avatar Mar 15 '22 02:03 SaptakBhoumik