-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes error while using generic From and Into traits.
This commit fixes 2 errors: First error: ``` 60 | let _i: Struct3 = 1_u64.into(); | ^^^^ Trait "MyFrom" is not implemented for type "U". ``` Second error: ``` 60 | let _i: Struct3 = 1_u64.into(); | ^^^^ Trait "MyFrom" is not implemented for type "Struct3". ``` First fix is to unify method return type with current ctx.type_annotation(). Second fix is to substituting the generic blanket type by call_path_typeid. Closes #5208
- Loading branch information
Showing
3 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/src/e2e_vm_tests/test_programs/should_pass/language/generic_trait_constraints/test.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
category = "run" | ||
expected_result = { action = "return", value = 1 } | ||
validate_abi = false | ||
expected_warnings = 3 | ||
expected_warnings = 1 |