Skip to content

Commit

Permalink
more wip
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Jul 25, 2023
1 parent 3cd97a9 commit 723fcba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions vyper/semantics/analysis/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
UnknownAttribute,
VariableDeclarationException,
VyperException,
ZeroDivisionException,
)
from vyper.semantics import types
from vyper.semantics.analysis.base import VarInfo
Expand Down Expand Up @@ -313,7 +314,7 @@ def visit_AugAssign(self, node):

lhs_info = get_expr_info(node.target)

#validate_expected_type(node.value, lhs_info.typ)
# validate_expected_type(node.value, lhs_info.typ)
lhs_info.validate_modification(node, self.func.mutability)

self.expr_visitor.visit(node.value, lhs_info.typ)
Expand Down Expand Up @@ -712,7 +713,7 @@ def visit_Call(self, node: vy_ast.Call, typ: Optional[VyperType] = None) -> None
# except for builtin functions, `get_exact_type_from_node`
# already calls `validate_expected_type` on the call args
# and kwargs via `call_type.fetch_call_return`
#self.visit(node.func, call_type)
# self.visit(node.func, call_type)

if isinstance(call_type, ContractFunctionT):
node._metadata["type"] = call_type.fetch_call_return(node)
Expand Down Expand Up @@ -885,14 +886,13 @@ def visit_List(self, node: vy_ast.List, typ: Optional[VyperType] = None) -> None
sarray_t = SArrayT(value_typ, count)
darray_t = DArrayT(value_typ, count)


if typ:
for t in (sarray_t, darray_t):
if typ.compare_type(t):
derived_typ = t
else:
raise TypeMismatch(f"Expected {sarray_t} or {darray_t} but got {typ} instead", node)

else:
derived_typ = darray_t

Expand Down Expand Up @@ -995,6 +995,6 @@ def visit_IfExp(self, node: vy_ast.IfExp, typ: Optional[VyperType] = None) -> No
if t.compare_type(typ):
break
else:
raise TypeMismatch(f"{typ} is not a possible type", node)
raise TypeMismatch(f"{typ} is not a possible type", node)
self.visit(node.body, typ)
self.visit(node.orelse, typ)
2 changes: 1 addition & 1 deletion vyper/semantics/analysis/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def _validate_self_namespace():
if not check_constant(node.value):
raise StateAccessViolation("Value must be a literal", node.value)

#validate_expected_type(node.value, type_)
# validate_expected_type(node.value, type_)
_validate_self_namespace()

return _finalize()
Expand Down

0 comments on commit 723fcba

Please sign in to comment.