Merged
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | -25 |
| Duplication | -2 |
🟢 Coverage 94.00% diff coverage · -0.52% coverage variation
Metric Results Coverage variation ✅ -0.52% coverage variation (-1.00%) Diff coverage ✅ 94.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (cb37266) 1801 1627 90.34% Head commit (1da860a) 1749 (-52) 1571 (-56) 89.82% (-0.52%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#6) 150 141 94.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
TIP This summary will be updated as you push new changes. Give us feedback
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request overhauls the type system. Here are the main major changes, and their reasons:
Change: Variable declaration now always require explicit type.
Reason: Type inference is a source of subtle logic bugs, enforcing explicit types, ensures least amount of voodoo.. (i.e. programmer does own x = 1, and that type inferred is int8, and if he try to increment x beyond int8 capacity, it would overflow. Enforcing programmer always writes explicit types helps make those types of bugs visible). Unfortunately though, type inference is still used internally within the compiler's semantic phase, and it has to be. This is a general problem that affects pretty much all compilers. Except our inference system now is less exposed, and simpler.
Change: Removal of the internal "Infer" type, which helps reduce bugs.
Reason: We previously had many guard statements around the codebase to prevent statements/expressions of type "Infer" from getting past semantic phase, removing "Infer" type completely reduces complexity, and bugs within compiler its self.
Change: Added more readable array syntax
Reason: Previous we had arrays like:
own x int32[][] = int32[][ int32[1,2], int32[3,4] ]syntax, which is ugly once you get down to nested arrays like in that example. New syntax is much more readable: ```own x [][]int32 = [ [1,2], [3,4] ]Change: Variable overshadowing is now not allowed at all
Reason: This will force programmers to write clean variable names, and will reduce logic bugs cased by implicit type conversions.
I also removed a lot of unused and duplicated functions. The code cyclic complexity metric should go down noticeably.
And I improved parser and semantic unit tests, made some also less brittle to changes.