Skip to content

Commit

Permalink
chatgpt comments
Browse files Browse the repository at this point in the history
  • Loading branch information
inclyc committed Aug 2, 2024
1 parent 5c2cbfb commit cccd515
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions libnixf/src/Sema/VariableLookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,15 @@ void VariableLookupAnalysis::dfs(const ExprLambda &Lambda,

// { foo, bar, ... } : body
// ^~~~~~~~~<-------------- add function formals.
// Here it is distinguished between formal *with* an argument and without.
// Example:

// This section differentiates between formal parameters with an argument and
// without. Example:
//
// { foo }@arg : use arg
//
// In this case, definition `foo` is not used, however it might be used via
// arg.foo. So the serverity of unused formal is demoted in this case.
// In this case, the definition of `foo` is not used directly; however, it
// might be accessed via arg.foo. Therefore, the severity of an unused formal
// parameter is reduced in this scenario.
if (Arg.formals()) {
for (const auto &[Name, Formal] : Arg.formals()->dedup()) {
Definition::DefinitionSource Source =
Expand Down

0 comments on commit cccd515

Please sign in to comment.