Skip to content

Commit

Permalink
Adds test that covers #5162
Browse files Browse the repository at this point in the history
  • Loading branch information
esdrubal committed Nov 2, 2023
1 parent fb08e36 commit 181acad
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[[package]]
name = "generic_and_associated_type"
source = "member"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[project]
authors = ["Fuel Labs <[email protected]>"]
license = "Apache-2.0"
name = "generic_and_associated_type"
entry = "main.sw"
implicit-std = false
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
script;

trait TypeTrait {
type T;

fn method() -> Self::T;
} {
fn method2<T>() -> T {
Self::method()
}
}

fn main() -> u32 {
1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
category = "fail"

# check: $()Self::method()
# nextln: $()Mismatched types.
# nextln: $()expected: T
# nextln: $()found: trait type Self::T
# nextln: $()help: Function return type does not match up with local type annotation.

0 comments on commit 181acad

Please sign in to comment.