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

fix(compiler): cant call fromJson on imported structs #3944

Merged
merged 5 commits into from
Aug 24, 2023

Conversation

hasanaburayyan
Copy link
Contributor

@hasanaburayyan hasanaburayyan commented Aug 23, 2023

Closes: #3792

Now supports calling fromJson on structs that were brought from other wing files

example:
file_1.w

struct Person {
	name: str;
}

file_2.w

bring "./file1.w" as f1;

let j = { name: "cool" };
f1.Person.fromJson(j);

Checklist

  • Title matches Winglang's style guide
  • Description explains motivation and solution
  • Tests added (always)
  • Docs updated (only required for features)
  • Added pr/e2e-full label if this feature requires end-to-end testing

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

@hasanaburayyan hasanaburayyan requested a review from a team as a code owner August 23, 2023 23:02
@hasanaburayyan hasanaburayyan changed the title feat(compiler): support fromJson on imported structs fix(compiler): cant call fromJson on imported structs Aug 23, 2023
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Aug 23, 2023
@MarkMcCulloh MarkMcCulloh removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Aug 24, 2023
libs/wingc/src/type_check.rs Show resolved Hide resolved
examples/tests/valid/struct_from_json.w Show resolved Hide resolved
@mergify
Copy link
Contributor

mergify bot commented Aug 24, 2023

Thanks for contributing, @hasanaburayyan! This PR will now be added to the merge queue, or immediately merged if hasan/struct-conversion-multi-file is up-to-date with main and the queue is empty.

mergify bot added a commit that referenced this pull request Aug 24, 2023
@mergify mergify bot merged commit bd45fd5 into main Aug 24, 2023
11 checks passed
@mergify mergify bot deleted the hasan/struct-conversion-multi-file branch August 24, 2023 15:25
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.25.45.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Json: schema validation support fromJson for imported structs
4 participants