mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
Fix regression with contract docs and generics #1821
This commit is contained in:
@@ -4444,9 +4444,10 @@ static bool sema_analyse_generic_module_contracts(SemaContext *c, Module *module
|
||||
{
|
||||
Ast *ast = astptr(contract);
|
||||
contract = ast->next;
|
||||
ASSERT0(ast->ast_kind == AST_CONTRACT);
|
||||
ASSERT(ast, ast->ast_kind == AST_CONTRACT);
|
||||
SemaContext temp_context;
|
||||
ASSERT0(ast->contract_stmt.kind == CONTRACT_REQUIRE);
|
||||
if (ast->contract_stmt.kind == CONTRACT_COMMENT) continue;
|
||||
ASSERT(ast, ast->contract_stmt.kind == CONTRACT_REQUIRE);
|
||||
SemaContext *new_context = context_transform_for_eval(c, &temp_context, module->units[0]);
|
||||
FOREACH(Expr *, expr, ast->contract_stmt.contract.decl_exprs->expression_list)
|
||||
{
|
||||
|
||||
13
test/test_suite/generic/generic_with_comment.c3t
Normal file
13
test/test_suite/generic/generic_with_comment.c3t
Normal file
@@ -0,0 +1,13 @@
|
||||
module test;
|
||||
import generic;
|
||||
|
||||
// Issue #1821
|
||||
fn void main() {
|
||||
Generic(<int>) asdf;
|
||||
}
|
||||
|
||||
<*
|
||||
Hello
|
||||
*>
|
||||
module generic(<Param>);
|
||||
struct Generic { int a; }
|
||||
Reference in New Issue
Block a user