8000 Mixing callsite assign and callsite source · Issue #126 · zetzit/zz · GitHub
[go: up one dir, main page]

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

Mixing callsite assign and callsite source #126

Open

Description

@jwerle

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.

Activity

  1. aep commented on Sep 20, 2020

    @aep
    Collaborator

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0