Просмотр исходного кода

fixed a linting error in action.cpp (#2844)

There was a warning "Unchecked access to optional value" in this piece of code inside `action.cpp`
```cpp
  if (this->scope().has_value()) {
    out << " " << *this->scope();a
  }
```
Fixed it by accessing `scope_` directly rather than using `this->scope()`.
Prabhat Sachdeva 2 лет назад
Родитель
Сommit
c1722d9bf2
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      explorer/interpreter/action.cpp

+ 2 - 2
explorer/interpreter/action.cpp

@@ -152,8 +152,8 @@ void Action::Print(llvm::raw_ostream& out) const {
     }
     out << "]]";
   }
-  if (this->scope().has_value()) {
-    out << " " << *this->scope();
+  if (scope_.has_value()) {
+    out << " " << *scope_;
   }
 }