Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Mixing callsite assign and callsite source #126

Open
jwerle opened this issue Sep 20, 2020 · 1 comment
Open

Mixing callsite assign and callsite source #126

jwerle opened this issue Sep 20, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@jwerle
Copy link
Member

jwerle commented Sep 20, 2020

Consider the following hypothetical assert function that mixes callsite_source and callsite assign syntax:

fn assert(
  bool assertion,
  char* callsite_source<file> unsafe file,
  char* callsite_source<function> unsafe scope,
  usize callsite_source<line> line,
  char *message = 0
) {
 ...
}

The compiler will yield the following compilation error:

[ERROR] call argument count mismatch
  --> /home/werle/repos/zzmodules/runtime-assert/tests/pass.zz:10:3
   |
10 |   assert(true);␊
   |   ^----^
   |
   = function '::runtime_assert::assert' is defined over 5 arguments, but you passed 4

when the message argument is not defined. Is this intended? The compiler will succeed in compilation when the message argument is given.

@jwerle jwerle added the bug Something isn't working label Sep 20, 2020
@aep
Copy link
Collaborator

aep commented Sep 20, 2020

yeah mixing them is broken.
I don't really want to fix it tho, because callsite_source needs to be replaced entirely with a callsite assign macro call,

i.e. something like

  char* file  = @source(file)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants