+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

refactor(rome_diagnostics): change FileId from a type alias to a newtype struct #3232

Merged
merged 2 commits into from
Sep 15, 2022

Conversation

leops
Copy link
Contributor

@leops leops commented Sep 15, 2022

Summary

This is a change I extracted from #3222 to make the larger change easier to review. This PR changes the FileId type in rome_diagnostics from an alias of usize to a proper newtype struct. This makes is easier to implement specific behaviors and traits on that type, and could eventually allow us to change the internal representation of File IDs transparently for consumers of the type.

Test Plan

This is purely a type-level change, it should not impact the functionality of the code (for the most part the machine code generated by the compile should not change and the FileId struct should have the same memory layout as a raw usize)

@leops leops requested a review from a team September 15, 2022 14:13
@netlify
Copy link

netlify bot commented Sep 15, 2022

Deploy Preview for rometools canceled.

Name Link
🔨 Latest commit 891d365
🔍 Latest deploy log https://app.netlify.com/sites/rometools/deploys/6323369d5deac90008a52157

@leops leops temporarily deployed to netlify-playground September 15, 2022 14:13 Inactive
@github-actions
Copy link

github-actions bot commented Sep 15, 2022

@github-actions
Copy link

Parser conformance results on ubuntu-latest

js/262

Test result main count This PR count Difference
Total 45879 45879 0
Passed 44939 44939 0
Failed 940 940 0
Panics 0 0 0
Coverage 97.95% 97.95% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 39 39 0
Passed 36 36 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.31% 92.31% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 5946 5946 0
Passed 1621 1621 0
Failed 4325 4325 0
Panics 0 0 0
Coverage 27.26% 27.26% 0.00%

ts/babel

Test result main count This PR count Difference
Total 588 588 0
Passed 519 519 0
Failed 69 69 0
Panics 0 0 0
Coverage 88.27% 88.27% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 16257 16257 0
Passed 12395 12395 0
Failed 3862 3862 0
Panics 0 0 0
Coverage 76.24% 76.24% 0.00%

@leops leops temporarily deployed to netlify-playground September 15, 2022 14:28 Inactive
@leops leops merged commit 9c73d19 into main Sep 15, 2022
@leops leops deleted the refactor/file-id-newtype branch September 15, 2022 15:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载