Gradualizer icon indicating copy to clipboard operation
Gradualizer copied to clipboard

Fix refinable record fields

Open berbiche opened this issue 4 years ago • 2 comments

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)?

berbiche avatar Jul 16 '21 16:07 berbiche

Codecov Report

Merging #338 (0ada97e) into master (e226803) will decrease coverage by 0.01%. The diff coverage is 80.00%.

Impacted file tree graph

@@            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 data Powered by Codecov. Last update e226803...0ada97e. Read the comment docs.

codecov-commenter avatar Jul 16 '21 16:07 codecov-commenter

Found an issue with where pick_value is called with {type, _, any, []}.

I will fix this in a following commit.

berbiche avatar Jul 20 '21 21:07 berbiche