Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1258 from charles-cooper/fix_valency
Fix valency error in if-statements
- Loading branch information
Showing
3 changed files
with
32 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import pytest | ||
from vyper import compiler | ||
|
||
valid_list = [ | ||
""" | ||
@private | ||
def mkint() -> int128: | ||
return 1 | ||
@public | ||
def test_zerovalent(): | ||
if True: | ||
self.mkint() | ||
@public | ||
def test_valency_mismatch(): | ||
if True: | ||
self.mkint() | ||
else: | ||
pass | ||
""" | ||
] | ||
|
||
|
||
@pytest.mark.parametrize('good_code', valid_list) | ||
def test_conditional_return_code(good_code): | ||
assert compiler.compile_code(good_code) is not None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters