-
-
Notifications
You must be signed in to change notification settings - Fork 818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix[ux]: error messages relating to initializer issues #3831
fix[ux]: error messages relating to initializer issues #3831
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #3831 +/- ##
==========================================
- Coverage 90.92% 90.76% -0.17%
==========================================
Files 95 95
Lines 14395 14411 +16
Branches 3187 3193 +6
==========================================
- Hits 13089 13080 -9
- Misses 906 927 +21
- Partials 400 404 +4 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of a code smell that only one test changed with all of these updates
consider: import lib1
import lib2
import lib3
initializes: lib2[lib1:=lib1]
initializes: lib1
initializes: lib3 lib1 counter: uint256 lib3 counter: uint256 lib2 import lib1
import lib3
uses: lib1
uses: lib3
counter: uint256
@internal
def foo():
lib1.counter += 1
lib3.counter += 1 then:
ie the hint excludes the current |
vyper/semantics/analysis/module.py
Outdated
break | ||
|
||
if rhs is None: | ||
hint = "try importing {item.alias} first" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be an f-string, right
note: planning on changing the initializer syntax to look like |
it was missing tests for the new cases -- thanks @cyberthirst for help adding |
after thinking about it i think this is kind of a non-issue, both syntaxes are kind of ok, because the latter syntax helps make it clear when you use |
FWIW, I use the # @dev We import and initialise the `Ownable` module.
from .. import Ownable as ow
initializes: ow
# @dev We import and initialise the `Ownable2Step` module.
from .. import Ownable2Step as o2
initializes: o2[ownable := ow] |
fix some error messages related to initializers, to improve UX --------- Co-authored-by: cyberthirst <cyberthirst.eth@gmail.com>
What I did
fix some error messages
How I did it
How to verify it
Commit message
Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)
Description for the changelog
Cute Animal Picture