diff --git a/source/tlang/compiler/parsing/core.d b/source/tlang/compiler/parsing/core.d index 11359c92..d5420bb6 100644 --- a/source/tlang/compiler/parsing/core.d +++ b/source/tlang/compiler/parsing/core.d @@ -3661,7 +3661,7 @@ unittest } /** - * If statement tests + * Comments tests */ unittest { @@ -3711,6 +3711,13 @@ void function(int i, int p) TypeChecker tc = new TypeChecker(compiler); + /* Find the variable named `p` and get its comment */ + Entity varEnt = tc.getResolver().resolveBest(modulle, "p"); + Variable var = cast(Variable)varEnt; + Comment varComment = var.getComment(); + assert(varComment); + assert(varComment.getContent() == "Comment for Elise"); + /* Find the function named `function` and get its comment */ Entity funcEnt = tc.getResolver().resolveBest(modulle, "function"); Function func = cast(Function)funcEnt;