# E4017

Method of type is ambiguous, it may come from multiple traits.

## Erroneous Example

```moonbit
struct S { v : Int } derive(Show)

trait Tee { to_string(Self) -> String }

impl Tee for S with to_string(_self) { "Tee" }

let s : S = { v: 3 }
let t = s.to_string()
```

The example above tries to call the method `to_string` on a type `S`,
but the method name comes from both `Show` and `Tee` traits,
giving the following error on line 8:

```
Method to_string of type S is ambiguous, it may come from trait Tee or Show
```

## Suggestion

Disambiguate the method by specifying the trait it comes from:

```{literalinclude} /sources/error_codes/E4017_fixed/top.mbt
:language: moonbit
```
