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

generic compilerproc should give CT error #10516

Closed
timotheecour opened this issue Jan 31, 2019 · 1 comment
Closed

generic compilerproc should give CT error #10516

timotheecour opened this issue Jan 31, 2019 · 1 comment
Labels
Code Generation Invalid Code Acceptance Everything related to compiler not complaining about invalid code Low Priority

Comments

@timotheecour
Copy link
Member

this PR #10228 (at commit 38e8263) ran into that issue, but it didn't give a CT error because only 1 type was instantiated.

This snippet illustrates the problem:

proc foo[T](a: T) {.compilerproc.} =
  echo "ok1"

proc main()=
  #[
  uncomment either and it'll work
  otherwise gives cgen error:
  /tmp/nim/nimcache/timn_t0161.c:50:17: error: conflicting types for 'foo'
  N_NIMCALL(void, foo)(NF a);
  ]#
  foo(1)
  foo(1.1)

main()
@timotheecour timotheecour added Low Priority Code Generation Invalid Code Acceptance Everything related to compiler not complaining about invalid code labels Jan 31, 2019
@krux02
Copy link
Contributor

krux02 commented Feb 20, 2019

the compilerproc pragma is for internal use only. So far this missing error message is not blocking development.

@krux02 krux02 closed this as completed Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Generation Invalid Code Acceptance Everything related to compiler not complaining about invalid code Low Priority
Projects
None yet
Development

No branches or pull requests

2 participants