Thanks to visit codestin.com
Credit goes to github.com

Skip to content

compiler assert when switching on fault with case {} #2232

@Book-reader

Description

@Book-reader
fn int main(String[] args)
{
	int? tok;
	switch (fault err = @catch(tok))
	{
		case {}:
			io::printn("got valid token");
		case io::EOF:
			return 0;
		default:
			io::printfn("error: %s, %d", err, (usz)err);
	}
	return 0;
}
⚠️ The compiler encountered an unexpected error: "Violated assert: right->const_kind == CONST_FAULT".

- Function: expr_const_compare(...)
- Source file: /build/w69fakkshy722hpcnzds1mrg0rlsnxi2-source/src/compiler/number.c:139

🙏 Please consider taking the time to file an issue on GitHub, so that we can get it fixed:

https://github.com/c3lang/c3c/issues/new so that we can get it fixed.

Metadata

Metadata

Assignees

Labels

BugSomething isn't workingFixed needs testingNeeds verification / testing that it now works

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions