Fix refinable record fields
Previously, every record would be refined because the record
that was passed to refinable/3 always had no fields.
Gradualizer would then crash on pick_value for types it cannot
pick an example value.
Now, the record is looked up in the REnv and every typed field of the record is checked for "refinability".
Do I also need to lookup the records in gradualizer_db at that point (e.g. when checking for the refinement of a remote type)?
Codecov Report
Merging #338 (0ada97e) into master (e226803) will decrease coverage by
0.01%. The diff coverage is80.00%.
@@ Coverage Diff @@
## master #338 +/- ##
==========================================
- Coverage 87.46% 87.44% -0.02%
==========================================
Files 18 18
Lines 2760 2764 +4
==========================================
+ Hits 2414 2417 +3
- Misses 346 347 +1
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/typechecker.erl | 90.25% <80.00%> (-0.04%) |
:arrow_down: |
| src/gradualizer_lib.erl | 87.09% <0.00%> (-1.08%) |
:arrow_down: |
| src/gradualizer_fmt.erl | 75.35% <0.00%> (+0.70%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update e226803...0ada97e. Read the comment docs.
Found an issue with where pick_value is called with {type, _, any, []}.
I will fix this in a following commit.