Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
InsaneMiner opened this issue Mar 13, 2022 · 4 comments

Comments

@InsaneMiner
Copy link
Contributor

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);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

@SaptakBhoumik
Copy link
Owner

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

@InsaneMiner
Copy link
Contributor Author

@SaptakBhoumik Ok

@InsaneMiner
Copy link
Contributor Author

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

@SaptakBhoumik
Copy link
Owner

@InsaneMiner yes you can keep it open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants