Skip to content

Bug with nested generic type parameter #2369

@michabay05

Description

@michabay05

Description

As shown in the example below, the line inside the main function triggers an unexpected error. I believe the intended behavior for this would be to trigger a compilation error. Interestingly, the second line in the main function actually triggers a compilation error.


Minimum reproducible example

// file: repro.c3

module values{Type};

struct Values
{
    Type[] values;
    int count;
}

module main;

import values;
import std::collections::list;

fn void main()
{
    List{Values{}} v1s;          // This does not trigger a compilation error...
    // List{Values{int}} v2s;    // This does!
}

Output

$ c3c compile-run repro.c3

⚠️ The compiler encountered an unexpected error: "Violated assert: vec_size(params)".

- Function: sema_analyse_parameterized_identifier(...)
- Source file: /home/user/thirdparty/c3c-git/src/compiler/sema_decls.c:5150

🙏 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