Skip to content
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

Missing span for TypeProperty #1250

Merged
merged 1 commit into from
Apr 14, 2022
Merged

Missing span for TypeProperty #1250

merged 1 commit into from
Apr 14, 2022

Conversation

mohammadfawaz
Copy link
Contributor

Closes #1231

These are internal errors and the user shouldn't try to decode them, but it's still worth passing a span to help us debug issues.

E.g. we now get this error for the test case in the issue:

error
  --> proj/src/main.sw:11:16
   |
 9 |
10 |   fn new() -> RawVec<T> {
11 |     let size = size_of::<T>();
   |                ^^^^^^^^^^^^^^ Internal compiler error: Generic type cannot be resolved in IR.
Please file an issue on the repository and include the code that triggered this error.
12 |     RawVec {
13 |       ptr: 0,
   |
____

@mohammadfawaz mohammadfawaz self-assigned this Apr 14, 2022
@mohammadfawaz mohammadfawaz added bug Something isn't working compiler General compiler. Should eventually become more specific as the issue is triaged labels Apr 14, 2022
Copy link
Contributor

@mitchmindtree mitchmindtree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (with my limited knowledge of sway-core)

@mohammadfawaz mohammadfawaz merged commit cdea8fa into master Apr 14, 2022
@mohammadfawaz mohammadfawaz deleted the mohammadfawaz/1231 branch April 14, 2022 14:09
@otrho
Copy link
Contributor

otrho commented Apr 14, 2022

There might be more of these spanless conversions which could be fixed, dunno. It was mostly written before I'd added spans via metadata to IR.

@mohammadfawaz
Copy link
Contributor Author

I'll open an issue to track the rest of them :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler General compiler. Should eventually become more specific as the issue is triaged
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

IR is lacking span for generics error
3 participants