Skip to content

Commit

Permalink
remove dead variable: Context.in_assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Jan 14, 2024
1 parent 46140f4 commit d6d7de7
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions vyper/codegen/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ def __init__(
# Is the function constant?
self.constancy = constancy

# Whether body is currently in an assert statement
# XXX: dead, never set to True
self.in_assertion = False

# Whether we are currently parsing a range expression
self.in_range_expr = False

Expand All @@ -95,7 +91,7 @@ def __init__(
self.is_ctor_context = is_ctor_context

def is_constant(self):
return self.constancy is Constancy.Constant or self.in_assertion or self.in_range_expr
return self.constancy is Constancy.Constant or self.in_range_expr

def check_is_not_constant(self, err, expr):
if self.is_constant():
Expand Down Expand Up @@ -250,9 +246,7 @@ def lookup_var(self, varname):

# Pretty print constancy for error messages
def pp_constancy(self):
if self.in_assertion:
return "an assertion"
elif self.in_range_expr:
if self.in_range_expr:
return "a range expression"
elif self.constancy == Constancy.Constant:
return "a constant function"
Expand Down

0 comments on commit d6d7de7

Please sign in to comment.