-
Notifications
You must be signed in to change notification settings - Fork 11
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
Introduce Identifier remove a lot of Strings #192
Conversation
Codecov Report
@@ Coverage Diff @@
## master #192 +/- ##
==========================================
+ Coverage 83.16% 83.23% +0.06%
==========================================
Files 49 50 +1
Lines 3237 3256 +19
Branches 138 136 -2
==========================================
+ Hits 2692 2710 +18
- Misses 545 546 +1
Continue to review full report at Codecov.
|
Referant.importedTypes(imps) | ||
|
||
val resolveImportedCons: Map[String, (PackageName, ConstructorName)] = | ||
val resolveImportedCons: Map[Identifier, (PackageName, Constructor)] = |
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.
Seems the key here should be Constructor.
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 isn't easy actually, imports don't know currently if the are bindable or constructors. I'm going to leave it as Identifier, which is at least an improvement.
@@ -151,7 +153,7 @@ object DefRecursionCheck { | |||
*/ | |||
def checkForIllegalBinds[A]( | |||
state: State, | |||
bs: Iterable[String], | |||
bs: Iterable[Identifier.Bindable], |
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.
Bindable has been imported.
This was not a fun refactor, but it was real techdebt.
Previously, we were using
String
in many cases for identifiers. It is hard to refactor such code because we don't know which of those are referring to binding names, type names or Constructors.This introduces Identifier which is intended to keep track of this and be clear that we are never recreating those strings after parsing.
This is related to #12 and #70 since both of those will need to touch how identifiers are delt with.