forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing the implementation of supertraits to match Rust (FuelLabs#835)
- Loading branch information
1 parent
6faf43f
commit d22a1ab
Showing
24 changed files
with
358 additions
and
366 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
author = "Fuel Labs <[email protected]>" | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
name = "supertraits_dup_methods_2" | ||
name = "missing_func_from_supertrait_impl" |
File renamed without changes.
50 changes: 50 additions & 0 deletions
50
test/src/e2e_vm_tests/test_programs/missing_func_from_supertrait_impl/src/main.sw
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
script; | ||
|
||
trait A { | ||
fn a1(); | ||
fn a2(); | ||
} | ||
|
||
trait B: A { | ||
fn b(); | ||
} | ||
|
||
trait C { | ||
fn c(); | ||
} | ||
|
||
trait D: C + B { | ||
fn d(); | ||
} | ||
|
||
struct X { x: u64 } | ||
impl A for X { | ||
fn a1() { } | ||
fn a2() { } | ||
} | ||
impl B for X { | ||
fn b() { } | ||
} | ||
impl C for X { | ||
fn c() { } | ||
} | ||
impl D for X { | ||
fn d() { } | ||
} | ||
|
||
struct Y { y: u64 } | ||
// This code shouldn't compile because the implementation of `A` below is missing `fn a2()`: | ||
impl A for Y { | ||
fn a1() { } | ||
} | ||
impl B for Y { | ||
fn b() { } | ||
} | ||
impl C for Y { | ||
fn c() { } | ||
} | ||
impl D for Y { | ||
fn d() { } | ||
} | ||
|
||
fn main() { } |
22 changes: 0 additions & 22 deletions
22
test/src/e2e_vm_tests/test_programs/missing_supertrait/src/main.sw
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.