Skip to content

Commit

Permalink
Adds test that proves unexpected error no longer occcurs. (#5910)
Browse files Browse the repository at this point in the history
## Description

The issue reported in #4689 is already fixed.
This PR only adds a test to prove it works as expected.

Closes #4689.

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.

Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
  • Loading branch information
esdrubal and JoshuaBatty committed Apr 24, 2024
1 parent 4afe1c6 commit dd0e9a0
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[[package]]
name = "generic_struct_instantiation"
source = "member"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[project]
authors = ["Fuel Labs <contact@fuel.sh>"]
license = "Apache-2.0"
name = "generic_struct_instantiation"
entry = "main.sw"
implicit-std = false
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
script;

trait Trait {
fn method();
}

#[allow(dead_code)]
struct Struct<T> where T: Trait {

}

impl Trait for u64 {
#[allow(dead_code)]
fn method() {}
}

#[allow(dead_code)]
const C: Struct<u64> = Struct{};

fn main() -> u64 {
1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
category = "run"
expected_result = { action = "return", value = 1 }
validate_abi = false

0 comments on commit dd0e9a0

Please sign in to comment.