Skip to content

violated assert #1805

@Androthi

Description

@Androthi

Messing around with compile time macros. Likely breaking rules here and making the compiler do things it wasn't designed to do.

$foreach ( $c : $chars)
        int $offset = ($c - $from) / BITS;
        int $rem = ($c - $from) % BITS;
        uint128 $value = $bitmap[$offset];
        $value |= 1u128 << $rem;
        $bitmap = $bitmap[:$offset] +++ $value +++ $bitmap[$offset+1..];
$endforeach

the final expression causes the assert violation.

The compiler encountered an unexpected error: "Violated assert: element->const_expr.const_kind == CONST_INITIALIZER".

  • Function: sema_expr_analyse_ct_concat(...)
  • Source file: D:\dev\c3c\src\compiler\sema_const.c:430

Metadata

Metadata

Assignees

Labels

Fixed needs testingNeeds verification / testing that it now works

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions