Repository: tact-lang/tact

Issue:
Misleading Error Message for Conflicting Trait Functions
When two traits define a function with the same name and a contract implements both, the compiler correctly identifies the conflict — but the **error message is misleading**.

Given the following code:

```tact
trait TraitA {
    fun f(): Int {
        return 1;
    }
}

trait TraitB {
    fun f(): Int {
        return 2;
    }
}

contract TestContract() with TraitA, TraitB {
    // nothing
}
```

The compiler outputs:

```
Error: test.tact:2:5: Function "f" is already defined in trait "TraitB"
  1 | trait TraitA {
> 2 |     fun f(): Int {
          ^~~~~~~~~~~~~~
  3 |         return 1;
```

### What’s Wrong

- The message says `Function "f" is already defined in trait "TraitB"` — but it's pointing to the definition in `TraitA`, which came first.
- It should say the function is **already defined in `TraitA`**, and the error is occurring **in `TraitB`**, since that’s the conflicting definition.

This creates confusion by reporting the right problem but pointing to the wrong location.

### ✅ Expected

The error should say:

```
Error: test.tact:8:5: Function "f" is already defined in trait "TraitA"
  7  | trait TraitB {
> 9  |     fun f(): Int {
          ^~~~~~~~~~~~~~
  10 |         return 2;
```

This would make the source of the problem and the compiler’s interpretation much clearer.

---

LLM Fuzzing discovery (see #2490)

Discussion:

Solution patch:
diff --git a/dev-docs/CHANGELOG.md b/dev-docs/CHANGELOG.md
index 1ee6b60f..cff1c358 100644
--- a/dev-docs/CHANGELOG.md
+++ b/dev-docs/CHANGELOG.md
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - [fix] Compiler now correctly generates code for functions with several wildcard parameters: PR [#2703](https://github.com/tact-lang/tact/pull/2703)
 - [fix] Compiler now checks that "override" functions and constants have a virtual or abstract modifier in the parent trait: PR [#2700](https://github.com/tact-lang/tact/pull/2700)
 - [fix] Compiler now throws an error if a non-optional method is called on an optional type: PR [#2770](https://github.com/tact-lang/tact/pull/2770)
+- [fix] Compiler now throws an error when inheriting from two traits that have methods with the same name: PR [#2773](https://github.com/tact-lang/tact/pull/2773)
 - [fix] Generated TypeScript wrappers now export all functions for serialization/deserialization: PR [#2706](https://github.com/tact-lang/tact/pull/2706)
 - [fix] Processing of `null` values of optional types in the `dump` builtin: PR [#2730](https://github.com/tact-lang/tact/pull/2730)
 
diff --git a/src/types/__snapshots__/resolveDescriptors.spec.ts.snap b/src/types/__snapshots__/resolveDescriptors.spec.ts.snap
index 2cef2244..259ec28d 100644
--- a/src/types/__snapshots__/resolveDescriptors.spec.ts.snap
+++ b/src/types/__snapshots__/resolveDescriptors.spec.ts.snap
@@ -586,6 +586,87 @@ exports[`resolveDescriptors should fail descriptors for method-first-param-not-s
 "
 `;
 
+exports[`resolveDescriptors should fail descriptors for multi-inheritance-with-duplicate-abstract-methods 1`] = `
+"<unknown>:15:10: Both "TraitB" and "TraitA" define method "f"
+  14 | 
+> 15 | contract TestContract with TraitA, TraitB {}
+                ^~~~~~~~~~~~
+  16 | 
+"
+`;
+
+exports[`resolveDescriptors should fail descriptors for multi-inheritance-with-duplicate-methods 1`] = `
+"<unknown>:17:10: Both "TraitB" and "TraitA" define method "f"
+  16 | 
+> 17 | contract TestContract with TraitA, TraitB {}
+                ^~~~~~~~~~~~
+  18 | 
+"
+`;
+
+exports[`resolveDescriptors should fail descriptors for multi-inheritance-with-duplicate-methods-abstract-and-abstract-method 1`] = `
+"<unknown>:13:10: Both "TraitB" and "TraitA" define method "f"
+  12 | 
+> 13 | contract TestContract with TraitA, TraitB {
+                ^~~~~~~~~~~~
+  14 |     fun f(): Int {}
+"
+`;
+
+exports[`resolveDescriptors should fail descriptors for multi-inheritance-with-duplicate-methods-abstract-and-virtual-method 1`] = `
+"<unknown>:15:10: Both "TraitB" and "TraitA" define method "f"
+  14 | 
+> 15 | contract TestContract with TraitA, TraitB {
+                ^~~~~~~~~~~~
+  16 |     fun f(): Int {}
+"
+`;
+
+exports[`resolveDescriptors should fail descriptors for multi-inheritance-with-duplicate-methods-complex-hierarchy 1`] = `
+"<unknown>:24:5: Function "f" is already defined in trait "TraitA"
+  23 | contract TestContract with TraitC {
+> 24 |     fun f(): Int {
+           ^~~~~~~~~~~~~~
+  25 |         return 4;
+"
+`;
+
+exports[`resolveDescriptors should fail descriptors for multi-inheritance-with-duplicate-methods-deep 1`] = `
+"<unknown>:19:10: Both "TraitB" and "TraitA" define method "f"
+  18 | 
+> 19 | contract TestContract with TraitA, TraitC {}
+                ^~~~~~~~~~~~
+  20 | 
+"
+`;
+
+exports[`resolveDescriptors should fail descriptors for multi-inheritance-with-duplicate-methods-for-trait 1`] = `
+"<unknown>:17:7: Both "TraitB" and "TraitA" define method "f"
+  16 | 
+> 17 | trait Test with TraitA, TraitB {}
+             ^~~~
+  18 | 
+"
+`;
+
+exports[`resolveDescriptors should fail descriptors for multi-inheritance-with-duplicate-methods-three-traits 1`] = `
+"<unknown>:23:10: Both "TraitB" and "TraitA" define method "f"
+  22 | 
+> 23 | contract TestContract with TraitA, TraitB, TraitC {}
+                ^~~~~~~~~~~~
+  24 | 
+"
+`;
+
+exports[`resolveDescriptors should fail descriptors for multi-inheritance-with-duplicate-methods-virtual-and-virtual-method 1`] = `
+"<unknown>:17:10: Both "TraitB" and "TraitA" define method "f"
+  16 | 
+> 17 | contract TestContract with TraitA, TraitB {
+                ^~~~~~~~~~~~
+  18 |     override fun f(): Int {}
+"
+`;
+
 exports[`resolveDescriptors should fail descriptors for native-fun-getter 1`] = `
 "<unknown>:9:1: Native functions cannot be getters
   8 | @name(hello_world)
@@ -15376,6 +15457,1393 @@ exports[`resolveDescriptors should resolve descriptors for message-opcode-expr 1
 
 exports[`resolveDescriptors should resolve descriptors for message-opcode-expr 2`] = `[]`;
 
+exports[`resolveDescriptors should resolve descriptors for multi-inheritance-with-duplicate-methods-via-diamond 1`] = `
+[
+  {
+    "ast": {
+      "id": 2,
+      "kind": "primitive_type_decl",
+      "loc": primitive Int;,
+      "name": {
+        "id": 1,
+        "kind": "id",
+        "loc": Int,
+        "text": "Int",
+      },
+    },
+    "constants": [],
+    "dependsOn": [],
+    "fields": [],
+    "functions": Map {},
+    "header": null,
+    "init": null,
+    "interfaces": [],
+    "kind": "primitive_type_decl",
+    "name": "Int",
+    "origin": "user",
+    "partialFieldCount": 0,
+    "receivers": [],
+    "signature": null,
+    "tlb": null,
+    "traits": [],
+    "uid": 38154,
+  },
+  {
+    "ast": {
+      "attributes": [],
+      "declarations": [],
+      "id": 4,
+      "kind": "trait",
+      "loc": trait BaseTrait {},
+      "name": {
+        "id": 3,
+        "kind": "id",
+        "loc": BaseTrait,
+        "text": "BaseTrait",
+      },
+      "traits": [],
+    },
+    "constants": [],
+    "dependsOn": [],
+    "fields": [],
+    "functions": Map {},
+    "header": null,
+    "init": null,
+    "interfaces": [],
+    "kind": "trait",
+    "name": "BaseTrait",
+    "origin": "user",
+    "partialFieldCount": 0,
+    "receivers": [],
+    "signature": null,
+    "tlb": null,
+    "traits": [],
+    "uid": 1020,
+  },
+  {
+    "ast": {
+      "attributes": [],
+      "declarations": [
+        {
+          "attributes": [],
+          "id": 10,
+          "kind": "function_def",
+          "loc": fun f(): Int {
+        return 1;
+    },
+          "name": {
+            "id": 6,
+            "kind": "id",
+            "loc": f,
+            "text": "f",
+          },
+          "params": [],
+          "return": {
+            "id": 7,
+            "kind": "type_id",
+            "loc": Int,
+            "text": "Int",
+          },
+          "statements": [
+            {
+              "expression": {
+                "base": 10,
+                "id": 8,
+                "kind": "number",
+                "loc": 1,
+                "value": 1n,
+              },
+              "id": 9,
+              "kind": "statement_return",
+              "loc": return 1;,
+            },
+          ],
+        },
+      ],
+      "id": 11,
+      "kind": "trait",
+      "loc": trait TraitA {
+    fun f(): Int {
+        return 1;
+    }
+},
+      "name": {
+        "id": 5,
+        "kind": "id",
+        "loc": TraitA,
+        "text": "TraitA",
+      },
+      "traits": [],
+    },
+    "constants": [],
+    "dependsOn": [],
+    "fields": [],
+    "functions": Map {
+      "f" => {
+        "ast": {
+          "attributes": [],
+          "id": 10,
+          "kind": "function_def",
+          "loc": fun f(): Int {
+        return 1;
+    },
+          "name": {
+            "id": 6,
+            "kind": "id",
+            "loc": f,
+            "text": "f",
+          },
+          "params": [],
+          "return": {
+            "id": 7,
+            "kind": "type_id",
+            "loc": Int,
+            "text": "Int",
+          },
+          "statements": [
+            {
+              "expression": {
+                "base": 10,
+                "id": 8,
+                "kind": "number",
+                "loc": 1,
+                "value": 1n,
+              },
+              "id": 9,
+              "kind": "statement_return",
+              "loc": return 1;,
+            },
+          ],
+        },
+        "isAbstract": false,
+        "isGetter": false,
+        "isInline": false,
+        "isMutating": true,
+        "isOverride": false,
+        "isVirtual": false,
+        "methodId": null,
+        "name": "f",
+        "origin": "user",
+        "params": [],
+        "returns": {
+          "kind": "ref",
+          "name": "Int",
+          "optional": false,
+        },
+        "self": {
+          "kind": "ref",
+          "name": "TraitA",
+          "optional": false,
+        },
+      },
+    },
+    "header": null,
+    "init": null,
+    "interfaces": [],
+    "kind": "trait",
+    "name": "TraitA",
+    "origin": "user",
+    "partialFieldCount": 0,
+    "receivers": [],
+    "signature": null,
+    "tlb": null,
+    "traits": [],
+    "uid": 39380,
+  },
+  {
+    "ast": {
+      "attributes": [],
+      "declarations": [],
+      "id": 14,
+      "kind": "trait",
+      "loc": trait TraitB with TraitA {},
+      "name": {
+        "id": 12,
+        "kind": "id",
+        "loc": TraitB,
+        "text": "TraitB",
+      },
+      "traits": [
+        {
+          "id": 13,
+          "kind": "id",
+          "loc": TraitA,
+          "text": "TraitA",
+        },
+      ],
+    },
+    "constants": [],
+    "dependsOn": [],
+    "fields": [],
+    "functions": Map {
+      "f" => {
+        "ast": {
+          "attributes": [],
+          "id": 31,
+          "kind": "function_def",
+          "loc": fun f(): Int {
+        return 1;
+    },
+          "name": {
+            "id": 6,
+            "kind": "id",
+            "loc": f,
+            "text": "f",
+          },
+          "params": [],
+          "return": {
+            "id": 28,
+            "kind": "type_id",
+            "loc": Int,
+            "text": "Int",
+          },
+          "statements": [
+            {
+              "expression": {
+                "base": 10,
+                "id": 29,
+                "kind": "number",
+                "loc": 1,
+                "value": 1n,
+              },
+              "id": 30,
+              "kind": "statement_return",
+              "loc": return 1;,
+            },
+          ],
+        },
+        "isAbstract": false,
+        "isGetter": false,
+        "isInline": false,
+        "isMutating": true,
+        "isOverride": false,
+        "isVirtual": false,
+        "methodId": null,
+        "name": "f",
+        "origin": "user",
+        "params": [],
+        "returns": {
+          "kind": "ref",
+          "name": "Int",
+          "optional": false,
+        },
+        "self": {
+          "kind": "ref",
+          "name": "TraitB",
+          "optional": false,
+        },
+      },
+    },
+    "header": null,
+    "init": null,
+    "interfaces": [],
+    "kind": "trait",
+    "name": "TraitB",
+    "origin": "user",
+    "partialFieldCount": 0,
+    "receivers": [],
+    "signature": null,
+    "tlb": null,
+    "traits": [
+      {
+        "ast": {
+          "attributes": [],
+          "declarations": [
+            {
+              "attributes": [],
+              "id": 10,
+              "kind": "function_def",
+              "loc": fun f(): Int {
+        return 1;
+    },
+              "name": {
+                "id": 6,
+                "kind": "id",
+                "loc": f,
+                "text": "f",
+              },
+              "params": [],
+              "return": {
+                "id": 7,
+                "kind": "type_id",
+                "loc": Int,
+                "text": "Int",
+              },
+              "statements": [
+                {
+                  "expression": {
+                    "base": 10,
+                    "id": 8,
+                    "kind": "number",
+                    "loc": 1,
+                    "value": 1n,
+                  },
+                  "id": 9,
+                  "kind": "statement_return",
+                  "loc": return 1;,
+                },
+              ],
+            },
+          ],
+          "id": 11,
+          "kind": "trait",
+          "loc": trait TraitA {
+    fun f(): Int {
+        return 1;
+    }
+},
+          "name": {
+            "id": 5,
+            "kind": "id",
+            "loc": TraitA,
+            "text": "TraitA",
+          },
+          "traits": [],
+        },
+        "constants": [],
+        "dependsOn": [],
+        "fields": [],
+        "functions": Map {
+          "f" => {
+            "ast": {
+              "attributes": [],
+              "id": 10,
+              "kind": "function_def",
+              "loc": fun f(): Int {
+        return 1;
+    },
+              "name": {
+                "id": 6,
+                "kind": "id",
+                "loc": f,
+                "text": "f",
+              },
+              "params": [],
+              "return": {
+                "id": 7,
+                "kind": "type_id",
+                "loc": Int,
+                "text": "Int",
+              },
+              "statements": [
+                {
+                  "expression": {
+                    "base": 10,
+                    "id": 8,
+                    "kind": "number",
+                    "loc": 1,
+                    "value": 1n,
+                  },
+                  "id": 9,
+                  "kind": "statement_return",
+                  "loc": return 1;,
+                },
+              ],
+            },
+            "isAbstract": false,
+            "isGetter": false,
+            "isInline": false,
+            "isMutating": true,
+            "isOverride": false,
+            "isVirtual": false,
+            "methodId": null,
+            "name": "f",
+            "origin": "user",
+            "params": [],
+            "returns": {
+              "kind": "ref",
+              "name": "Int",
+              "optional": false,
+            },
+            "self": {
+              "kind": "ref",
+              "name": "TraitA",
+              "optional": false,
+            },
+          },
+        },
+        "header": null,
+        "init": null,
+        "interfaces": [],
+        "kind": "trait",
+        "name": "TraitA",
+        "origin": "user",
+        "partialFieldCount": 0,
+        "receivers": [],
+        "signature": null,
+        "tlb": null,
+        "traits": [],
+        "uid": 39380,
+      },
+    ],
+    "uid": 43447,
+  },
+  {
+    "ast": {
+      "attributes": [],
+      "declarations": [],
+      "id": 17,
+      "kind": "trait",
+      "loc": trait TraitC with TraitA {},
+      "name": {
+        "id": 15,
+        "kind": "id",
+        "loc": TraitC,
+        "text": "TraitC",
+      },
+      "traits": [
+        {
+          "id": 16,
+          "kind": "id",
+          "loc": TraitA,
+          "text": "TraitA",
+        },
+      ],
+    },
+    "constants": [],
+    "dependsOn": [],
+    "fields": [],
+    "functions": Map {
+      "f" => {
+        "ast": {
+          "attributes": [],
+          "id": 35,
+          "kind": "function_def",
+          "loc": fun f(): Int {
+        return 1;
+    },
+          "name": {
+            "id": 6,
+            "kind": "id",
+            "loc": f,
+            "text": "f",
+          },
+          "params": [],
+          "return": {
+            "id": 32,
+            "kind": "type_id",
+            "loc": Int,
+            "text": "Int",
+          },
+          "statements": [
+            {
+              "expression": {
+                "base": 10,
+                "id": 33,
+                "kind": "number",
+                "loc": 1,
+                "value": 1n,
+              },
+              "id": 34,
+              "kind": "statement_return",
+              "loc": return 1;,
+            },
+          ],
+        },
+        "isAbstract": false,
+        "isGetter": false,
+        "isInline": false,
+        "isMutating": true,
+        "isOverride": false,
+        "isVirtual": false,
+        "methodId": null,
+        "name": "f",
+        "origin": "user",
+        "params": [],
+        "returns": {
+          "kind": "ref",
+          "name": "Int",
+          "optional": false,
+        },
+        "self": {
+          "kind": "ref",
+          "name": "TraitC",
+          "optional": false,
+        },
+      },
+    },
+    "header": null,
+    "init": null,
+    "interfaces": [],
+    "kind": "trait",
+    "name": "TraitC",
+    "origin": "user",
+    "partialFieldCount": 0,
+    "receivers": [],
+    "signature": null,
+    "tlb": null,
+    "traits": [
+      {
+        "ast": {
+          "attributes": [],
+          "declarations": [
+            {
+              "attributes": [],
+              "id": 10,
+              "kind": "function_def",
+              "loc": fun f(): Int {
+        return 1;
+    },
+              "name": {
+                "id": 6,
+                "kind": "id",
+                "loc": f,
+                "text": "f",
+              },
+              "params": [],
+              "return": {
+                "id": 7,
+                "kind": "type_id",
+                "loc": Int,
+                "text": "Int",
+              },
+              "statements": [
+                {
+                  "expression": {
+                    "base": 10,
+                    "id": 8,
+                    "kind": "number",
+                    "loc": 1,
+                    "value": 1n,
+                  },
+                  "id": 9,
+                  "kind": "statement_return",
+                  "loc": return 1;,
+                },
+              ],
+            },
+          ],
+          "id": 11,
+          "kind": "trait",
+          "loc": trait TraitA {
+    fun f(): Int {
+        return 1;
+    }
+},
+          "name": {
+            "id": 5,
+            "kind": "id",
+            "loc": TraitA,
+            "text": "TraitA",
+          },
+          "traits": [],
+        },
+        "constants": [],
+        "dependsOn": [],
+        "fields": [],
+        "functions": Map {
+          "f" => {
+            "ast": {
+              "attributes": [],
+              "id": 10,
+              "kind": "function_def",
+              "loc": fun f(): Int {
+        return 1;
+    },
+              "name": {
+                "id": 6,
+                "kind": "id",
+                "loc": f,
+                "text": "f",
+              },
+              "params": [],
+              "return": {
+                "id": 7,
+                "kind": "type_id",
+                "loc": Int,
+                "text": "Int",
+              },
+              "statements": [
+                {
+                  "expression": {
+                    "base": 10,
+                    "id": 8,
+                    "kind": "number",
+                    "loc": 1,
+                    "value": 1n,
+                  },
+                  "id": 9,
+                  "kind": "statement_return",
+                  "loc": return 1;,
+                },
+              ],
+            },
+            "isAbstract": false,
+            "isGetter": false,
+            "isInline": false,
+            "isMutating": true,
+            "isOverride": false,
+            "isVirtual": false,
+            "methodId": null,
+            "name": "f",
+            "origin": "user",
+            "params": [],
+            "returns": {
+              "kind": "ref",
+              "name": "Int",
+              "optional": false,
+            },
+            "self": {
+              "kind": "ref",
+              "name": "TraitA",
+              "optional": false,
+            },
+          },
+        },
+        "header": null,
+        "init": null,
+        "interfaces": [],
+        "kind": "trait",
+        "name": "TraitA",
+        "origin": "user",
+        "partialFieldCount": 0,
+        "receivers": [],
+        "signature": null,
+        "tlb": null,
+        "traits": [],
+        "uid": 39380,
+      },
+    ],
+    "uid": 47510,
+  },
+  {
+    "ast": {
+      "attributes": [],
+      "declarations": [],
+      "id": 21,
+      "kind": "contract",
+      "loc": contract TestContract with TraitB, TraitC {},
+      "name": {
+        "id": 18,
+        "kind": "id",
+        "loc": TestContract,
+        "text": "TestContract",
+      },
+      "params": undefined,
+      "traits": [
+        {
+          "id": 19,
+          "kind": "id",
+          "loc": TraitB,
+          "text": "TraitB",
+        },
+        {
+          "id": 20,
+          "kind": "id",
+          "loc": TraitC,
+          "text": "TraitC",
+        },
+      ],
+    },
+    "constants": [],
+    "dependsOn": [],
+    "fields": [],
+    "functions": Map {
+      "f" => {
+        "ast": {
+          "attributes": [],
+          "id": 27,
+          "kind": "function_def",
+          "loc": fun f(): Int {
+        return 1;
+    },
+          "name": {
+            "id": 6,
+            "kind": "id",
+            "loc": f,
+            "text": "f",
+          },
+          "params": [],
+          "return": {
+            "id": 24,
+            "kind": "type_id",
+            "loc": Int,
+            "text": "Int",
+          },
+          "statements": [
+            {
+              "expression": {
+                "base": 10,
+                "id": 25,
+                "kind": "number",
+                "loc": 1,
+                "value": 1n,
+              },
+              "id": 26,
+              "kind": "statement_return",
+              "loc": return 1;,
+            },
+          ],
+        },
+        "isAbstract": false,
+        "isGetter": false,
+        "isInline": false,
+        "isMutating": true,
+        "isOverride": false,
+        "isVirtual": false,
+        "methodId": null,
+        "name": "f",
+        "origin": "user",
+        "params": [],
+        "returns": {
+          "kind": "ref",
+          "name": "Int",
+          "optional": false,
+        },
+        "self": {
+          "kind": "ref",
+          "name": "TestContract",
+          "optional": false,
+        },
+      },
+    },
+    "header": null,
+    "init": {
+      "ast": {
+        "id": 23,
+        "kind": "contract_init",
+        "loc": contract TestContract with TraitB, TraitC {},
+        "params": [],
+        "statements": [],
+      },
+      "kind": "init-function",
+      "params": [],
+    },
+    "interfaces": [],
+    "kind": "contract",
+    "name": "TestContract",
+    "origin": "user",
+    "partialFieldCount": 0,
+    "receivers": [],
+    "signature": "TestContract{}",
+    "tlb": "_  = TestContract",
+    "traits": [
+      {
+        "ast": {
+          "attributes": [],
+          "declarations": [],
+          "id": 4,
+          "kind": "trait",
+          "loc": trait BaseTrait {},
+          "name": {
+            "id": 3,
+            "kind": "id",
+            "loc": BaseTrait,
+            "text": "BaseTrait",
+          },
+          "traits": [],
+        },
+        "constants": [],
+        "dependsOn": [],
+        "fields": [],
+        "functions": Map {},
+        "header": null,
+        "init": null,
+        "interfaces": [],
+        "kind": "trait",
+        "name": "BaseTrait",
+        "origin": "user",
+        "partialFieldCount": 0,
+        "receivers": [],
+        "signature": null,
+        "tlb": null,
+        "traits": [],
+        "uid": 1020,
+      },
+      {
+        "ast": {
+          "attributes": [],
+          "declarations": [],
+          "id": 14,
+          "kind": "trait",
+          "loc": trait TraitB with TraitA {},
+          "name": {
+            "id": 12,
+            "kind": "id",
+            "loc": TraitB,
+            "text": "TraitB",
+          },
+          "traits": [
+            {
+              "id": 13,
+              "kind": "id",
+              "loc": TraitA,
+              "text": "TraitA",
+            },
+          ],
+        },
+        "constants": [],
+        "dependsOn": [],
+        "fields": [],
+        "functions": Map {
+          "f" => {
+            "ast": {
+              "attributes": [],
+              "id": 31,
+              "kind": "function_def",
+              "loc": fun f(): Int {
+        return 1;
+    },
+              "name": {
+                "id": 6,
+                "kind": "id",
+                "loc": f,
+                "text": "f",
+              },
+              "params": [],
+              "return": {
+                "id": 28,
+                "kind": "type_id",
+                "loc": Int,
+                "text": "Int",
+              },
+              "statements": [
+                {
+                  "expression": {
+                    "base": 10,
+                    "id": 29,
+                    "kind": "number",
+                    "loc": 1,
+                    "value": 1n,
+                  },
+                  "id": 30,
+                  "kind": "statement_return",
+                  "loc": return 1;,
+                },
+              ],
+            },
+            "isAbstract": false,
+            "isGetter": false,
+            "isInline": false,
+            "isMutating": true,
+            "isOverride": false,
+            "isVirtual": false,
+            "methodId": null,
+            "name": "f",
+            "origin": "user",
+            "params": [],
+            "returns": {
+              "kind": "ref",
+              "name": "Int",
+              "optional": false,
+            },
+            "self": {
+              "kind": "ref",
+              "name": "TraitB",
+              "optional": false,
+            },
+          },
+        },
+        "header": null,
+        "init": null,
+        "interfaces": [],
+        "kind": "trait",
+        "name": "TraitB",
+        "origin": "user",
+        "partialFieldCount": 0,
+        "receivers": [],
+        "signature": null,
+        "tlb": null,
+        "traits": [
+          {
+            "ast": {
+              "attributes": [],
+              "declarations": [
+                {
+                  "attributes": [],
+                  "id": 10,
+                  "kind": "function_def",
+                  "loc": fun f(): Int {
+        return 1;
+    },
+                  "name": {
+                    "id": 6,
+                    "kind": "id",
+                    "loc": f,
+                    "text": "f",
+                  },
+                  "params": [],
+                  "return": {
+                    "id": 7,
+                    "kind": "type_id",
+                    "loc": Int,
+                    "text": "Int",
+                  },
+                  "statements": [
+                    {
+                      "expression": {
+                        "base": 10,
+                        "id": 8,
+                        "kind": "number",
+                        "loc": 1,
+                        "value": 1n,
+                      },
+                      "id": 9,
+                      "kind": "statement_return",
+                      "loc": return 1;,
+                    },
+                  ],
+                },
+              ],
+              "id": 11,
+              "kind": "trait",
+              "loc": trait TraitA {
+    fun f(): Int {
+        return 1;
+    }
+},
+              "name": {
+                "id": 5,
+                "kind": "id",
+                "loc": TraitA,
+                "text": "TraitA",
+              },
+              "traits": [],
+            },
+            "constants": [],
+            "dependsOn": [],
+            "fields": [],
+            "functions": Map {
+              "f" => {
+                "ast": {
+                  "attributes": [],
+                  "id": 10,
+                  "kind": "function_def",
+                  "loc": fun f(): Int {
+        return 1;
+    },
+                  "name": {
+                    "id": 6,
+                    "kind": "id",
+                    "loc": f,
+                    "text": "f",
+                  },
+                  "params": [],
+                  "return": {
+                    "id": 7,
+                    "kind": "type_id",
+                    "loc": Int,
+                    "text": "Int",
+                  },
+                  "statements": [
+                    {
+                      "expression": {
+                        "base": 10,
+                        "id": 8,
+                        "kind": "number",
+                        "loc": 1,
+                        "value": 1n,
+                      },
+                      "id": 9,
+                      "kind": "statement_return",
+                      "loc": return 1;,
+                    },
+                  ],
+                },
+                "isAbstract": false,
+                "isGetter": false,
+                "isInline": false,
+                "isMutating": true,
+                "isOverride": false,
+                "isVirtual": false,
+                "methodId": null,
+                "name": "f",
+                "origin": "user",
+                "params": [],
+                "returns": {
+                  "kind": "ref",
+                  "name": "Int",
+                  "optional": false,
+                },
+                "self": {
+                  "kind": "ref",
+                  "name": "TraitA",
+                  "optional": false,
+                },
+              },
+            },
+            "header": null,
+            "init": null,
+            "interfaces": [],
+            "kind": "trait",
+            "name": "TraitA",
+            "origin": "user",
+            "partialFieldCount": 0,
+            "receivers": [],
+            "signature": null,
+            "tlb": null,
+            "traits": [],
+            "uid": 39380,
+          },
+        ],
+        "uid": 43447,
+      },
+      {
+        "ast": {
+          "attributes": [],
+          "declarations": [
+            {
+              "attributes": [],
+              "id": 10,
+              "kind": "function_def",
+              "loc": fun f(): Int {
+        return 1;
+    },
+              "name": {
+                "id": 6,
+                "kind": "id",
+                "loc": f,
+                "text": "f",
+              },
+              "params": [],
+              "return": {
+                "id": 7,
+                "kind": "type_id",
+                "loc": Int,
+                "text": "Int",
+              },
+              "statements": [
+                {
+                  "expression": {
+                    "base": 10,
+                    "id": 8,
+                    "kind": "number",
+                    "loc": 1,
+                    "value": 1n,
+                  },
+                  "id": 9,
+                  "kind": "statement_return",
+                  "loc": return 1;,
+                },
+              ],
+            },
+          ],
+          "id": 11,
+          "kind": "trait",
+          "loc": trait TraitA {
+    fun f(): Int {
+        return 1;
+    }
+},
+          "name": {
+            "id": 5,
+            "kind": "id",
+            "loc": TraitA,
+            "text": "TraitA",
+          },
+          "traits": [],
+        },
+        "constants": [],
+        "dependsOn": [],
+        "fields": [],
+        "functions": Map {
+          "f" => {
+            "ast": {
+              "attributes": [],
+              "id": 10,
+              "kind": "function_def",
+              "loc": fun f(): Int {
+        return 1;
+    },
+              "name": {
+                "id": 6,
+                "kind": "id",
+                "loc": f,
+                "text": "f",
+              },
+              "params": [],
+              "return": {
+                "id": 7,
+                "kind": "type_id",
+                "loc": Int,
+                "text": "Int",
+              },
+              "statements": [
+                {
+                  "expression": {
+                    "base": 10,
+                    "id": 8,
+                    "kind": "number",
+                    "loc": 1,
+                    "value": 1n,
+                  },
+                  "id": 9,
+                  "kind": "statement_return",
+                  "loc": return 1;,
+                },
+              ],
+            },
+            "isAbstract": false,
+            "isGetter": false,
+            "isInline": false,
+            "isMutating": true,
+            "isOverride": false,
+            "isVirtual": false,
+            "methodId": null,
+            "name": "f",
+            "origin": "user",
+            "params": [],
+            "returns": {
+              "kind": "ref",
+              "name": "Int",
+              "optional": false,
+            },
+            "self": {
+              "kind": "ref",
+              "name": "TraitA",
+              "optional": false,
+            },
+          },
+        },
+        "header": null,
+        "init": null,
+        "interfaces": [],
+        "kind": "trait",
+        "name": "TraitA",
+        "origin": "user",
+        "partialFieldCount": 0,
+        "receivers": [],
+        "signature": null,
+        "tlb": null,
+        "traits": [],
+        "uid": 39380,
+      },
+      {
+        "ast": {
+          "attributes": [],
+          "declarations": [],
+          "id": 17,
+          "kind": "trait",
+          "loc": trait TraitC with TraitA {},
+          "name": {
+            "id": 15,
+            "kind": "id",
+            "loc": TraitC,
+            "text": "TraitC",
+          },
+          "traits": [
+            {
+              "id": 16,
+              "kind": "id",
+              "loc": TraitA,
+              "text": "TraitA",
+            },
+          ],
+        },
+        "constants": [],
+        "dependsOn": [],
+        "fields": [],
+        "functions": Map {
+          "f" => {
+            "ast": {
+              "attributes": [],
+              "id": 35,
+              "kind": "function_def",
+              "loc": fun f(): Int {
+        return 1;
+    },
+              "name": {
+                "id": 6,
+                "kind": "id",
+                "loc": f,
+                "text": "f",
+              },
+              "params": [],
+              "return": {
+                "id": 32,
+                "kind": "type_id",
+                "loc": Int,
+                "text": "Int",
+              },
+              "statements": [
+                {
+                  "expression": {
+                    "base": 10,
+                    "id": 33,
+                    "kind": "number",
+                    "loc": 1,
+                    "value": 1n,
+                  },
+                  "id": 34,
+                  "kind": "statement_return",
+                  "loc": return 1;,
+                },
+              ],
+            },
+            "isAbstract": false,
+            "isGetter": false,
+            "isInline": false,
+            "isMutating": true,
+            "isOverride": false,
+            "isVirtual": false,
+            "methodId": null,
+            "name": "f",
+            "origin": "user",
+            "params": [],
+            "returns": {
+              "kind": "ref",
+              "name": "Int",
+              "optional": false,
+            },
+            "self": {
+              "kind": "ref",
+              "name": "TraitC",
+              "optional": false,
+            },
+          },
+        },
+        "header": null,
+        "init": null,
+        "interfaces": [],
+        "kind": "trait",
+        "name": "TraitC",
+        "origin": "user",
+        "partialFieldCount": 0,
+        "receivers": [],
+        "signature": null,
+        "tlb": null,
+        "traits": [
+          {
+            "ast": {
+              "attributes": [],
+              "declarations": [
+                {
+                  "attributes": [],
+                  "id": 10,
+                  "kind": "function_def",
+                  "loc": fun f(): Int {
+        return 1;
+    },
+                  "name": {
+                    "id": 6,
+                    "kind": "id",
+                    "loc": f,
+                    "text": "f",
+                  },
+                  "params": [],
+                  "return": {
+                    "id": 7,
+                    "kind": "type_id",
+                    "loc": Int,
+                    "text": "Int",
+                  },
+                  "statements": [
+                    {
+                      "expression": {
+                        "base": 10,
+                        "id": 8,
+                        "kind": "number",
+                        "loc": 1,
+                        "value": 1n,
+                      },
+                      "id": 9,
+                      "kind": "statement_return",
+                      "loc": return 1;,
+                    },
+                  ],
+                },
+              ],
+              "id": 11,
+              "kind": "trait",
+              "loc": trait TraitA {
+    fun f(): Int {
+        return 1;
+    }
+},
+              "name": {
+                "id": 5,
+                "kind": "id",
+                "loc": TraitA,
+                "text": "TraitA",
+              },
+              "traits": [],
+            },
+            "constants": [],
+            "dependsOn": [],
+            "fields": [],
+            "functions": Map {
+              "f" => {
+                "ast": {
+                  "attributes": [],
+                  "id": 10,
+                  "kind": "function_def",
+                  "loc": fun f(): Int {
+        return 1;
+    },
+                  "name": {
+                    "id": 6,
+                    "kind": "id",
+                    "loc": f,
+                    "text": "f",
+                  },
+                  "params": [],
+                  "return": {
+                    "id": 7,
+                    "kind": "type_id",
+                    "loc": Int,
+                    "text": "Int",
+                  },
+                  "statements": [
+                    {
+                      "expression": {
+                        "base": 10,
+                        "id": 8,
+                        "kind": "number",
+                        "loc": 1,
+                        "value": 1n,
+                      },
+                      "id": 9,
+                      "kind": "statement_return",
+                      "loc": return 1;,
+                    },
+                  ],
+                },
+                "isAbstract": false,
+                "isGetter": false,
+                "isInline": false,
+                "isMutating": true,
+                "isOverride": false,
+                "isVirtual": false,
+                "methodId": null,
+                "name": "f",
+                "origin": "user",
+                "params": [],
+                "returns": {
+                  "kind": "ref",
+                  "name": "Int",
+                  "optional": false,
+                },
+                "self": {
+                  "kind": "ref",
+                  "name": "TraitA",
+                  "optional": false,
+                },
+              },
+            },
+            "header": null,
+            "init": null,
+            "interfaces": [],
+            "kind": "trait",
+            "name": "TraitA",
+            "origin": "user",
+            "partialFieldCount": 0,
+            "receivers": [],
+            "signature": null,
+            "tlb": null,
+            "traits": [],
+            "uid": 39380,
+          },
+        ],
+        "uid": 47510,
+      },
+    ],
+    "uid": 63070,
+  },
+]
+`;
+
+exports[`resolveDescriptors should resolve descriptors for multi-inheritance-with-duplicate-methods-via-diamond 2`] = `[]`;
+
 exports[`resolveDescriptors should resolve descriptors for override-for-abstract-constant 1`] = `
 [
   {
diff --git a/src/types/resolveDescriptors.ts b/src/types/resolveDescriptors.ts
index 020849d1..11f7c71f 100644
--- a/src/types/resolveDescriptors.ts
+++ b/src/types/resolveDescriptors.ts
@@ -1785,6 +1785,32 @@ export function resolveDescriptors(ctx: CompilerContext, Ast: FactoryAst) {
             }
         }
 
+        const seenMethods: Map<string, [FunctionDescription, TypeDescription]> =
+            new Map();
+        for (const inheritedTrait of contractOrTrait.traits) {
+            for (const traitFunction of inheritedTrait.functions.values()) {
+                const previousInfo = seenMethods.get(traitFunction.name);
+                if (typeof previousInfo !== "undefined") {
+                    const [method, owner] = previousInfo;
+                    if (
+                        owner !== inheritedTrait &&
+                        !traitFunction.isOverride &&
+                        !method.isOverride
+                    ) {
+                        throwCompilationError(
+                            `Both "${inheritedTrait.name}" and "${owner.name}" define method "${traitFunction.name}"`,
+                            contractOrTrait.ast.name.loc,
+                        );
+                    }
+                }
+
+                seenMethods.set(traitFunction.name, [
+                    traitFunction,
+                    inheritedTrait,
+                ]);
+            }
+        }
+
         for (const inheritedTrait of contractOrTrait.traits) {
             // Copy functions
             for (const traitFunction of inheritedTrait.functions.values()) {
diff --git a/src/types/test-failed/multi-inheritance-with-duplicate-abstract-methods.tact b/src/types/test-failed/multi-inheritance-with-duplicate-abstract-methods.tact
new file mode 100644
index 00000000..8db7f770
--- /dev/null
+++ b/src/types/test-failed/multi-inheritance-with-duplicate-abstract-methods.tact
@@ -0,0 +1,15 @@
+primitive Int;
+
+trait BaseTrait {}
+
+trait TraitA {
+    abstract fun f(): Int;
+}
+
+trait TraitB {
+    fun f(): Int {
+        return 2;
+    }
+}
+
+contract TestContract with TraitA, TraitB {}
diff --git a/src/types/test-failed/multi-inheritance-with-duplicate-methods-abstract-and-abstract-method.tact b/src/types/test-failed/multi-inheritance-with-duplicate-methods-abstract-and-abstract-method.tact
new file mode 100644
index 00000000..39f0d8de
--- /dev/null
+++ b/src/types/test-failed/multi-inheritance-with-duplicate-methods-abstract-and-abstract-method.tact
@@ -0,0 +1,15 @@
+primitive Int;
+
+trait BaseTrait {}
+
+trait TraitA {
+    abstract fun f(): Int;
+}
+
+trait TraitB {
+    abstract fun f(): Int;
+}
+
+contract TestContract with TraitA, TraitB {
+    fun f(): Int {}
+}
diff --git a/src/types/test-failed/multi-inheritance-with-duplicate-methods-abstract-and-virtual-method.tact b/src/types/test-failed/multi-inheritance-with-duplicate-methods-abstract-and-virtual-method.tact
new file mode 100644
index 00000000..f5df2dc1
--- /dev/null
+++ b/src/types/test-failed/multi-inheritance-with-duplicate-methods-abstract-and-virtual-method.tact
@@ -0,0 +1,17 @@
+primitive Int;
+
+trait BaseTrait {}
+
+trait TraitA {
+    abstract fun f(): Int;
+}
+
+trait TraitB {
+    virtual fun f(): Int {
+        return 2;
+    }
+}
+
+contract TestContract with TraitA, TraitB {
+    fun f(): Int {}
+}
diff --git a/src/types/test-failed/multi-inheritance-with-duplicate-methods-complex-hierarchy.tact b/src/types/test-failed/multi-inheritance-with-duplicate-methods-complex-hierarchy.tact
new file mode 100644
index 00000000..02f52bb0
--- /dev/null
+++ b/src/types/test-failed/multi-inheritance-with-duplicate-methods-complex-hierarchy.tact
@@ -0,0 +1,27 @@
+primitive Int;
+
+trait BaseTrait {}
+
+trait TraitA {
+    fun f(): Int {
+        return 1;
+    }
+}
+
+trait TraitB with TraitA {
+    fun g(): Int {
+        return 2;
+    }
+}
+
+trait TraitC with TraitB {
+    fun h(): Int {
+        return 3;
+    }
+}
+
+contract TestContract with TraitC {
+    fun f(): Int {
+        return 4;
+    }
+}
diff --git a/src/types/test-failed/multi-inheritance-with-duplicate-methods-deep.tact b/src/types/test-failed/multi-inheritance-with-duplicate-methods-deep.tact
new file mode 100644
index 00000000..96451ecd
--- /dev/null
+++ b/src/types/test-failed/multi-inheritance-with-duplicate-methods-deep.tact
@@ -0,0 +1,19 @@
+primitive Int;
+
+trait BaseTrait {}
+
+trait TraitA {
+    fun f(): Int {
+        return 1;
+    }
+}
+
+trait TraitB {
+    fun f(): Int {
+        return 2;
+    }
+}
+
+trait TraitC with TraitB {}
+
+contract TestContract with TraitA, TraitC {}
diff --git a/src/types/test-failed/multi-inheritance-with-duplicate-methods-for-trait.tact b/src/types/test-failed/multi-inheritance-with-duplicate-methods-for-trait.tact
new file mode 100644
index 00000000..7cb17594
--- /dev/null
+++ b/src/types/test-failed/multi-inheritance-with-duplicate-methods-for-trait.tact
@@ -0,0 +1,17 @@
+primitive Int;
+
+trait BaseTrait {}
+
+trait TraitA {
+    fun f(): Int {
+        return 1;
+    }
+}
+
+trait TraitB {
+    fun f(): Int {
+        return 2;
+    }
+}
+
+trait Test with TraitA, TraitB {}
diff --git a/src/types/test-failed/multi-inheritance-with-duplicate-methods-three-traits.tact b/src/types/test-failed/multi-inheritance-with-duplicate-methods-three-traits.tact
new file mode 100644
index 00000000..fc616d0e
--- /dev/null
+++ b/src/types/test-failed/multi-inheritance-with-duplicate-methods-three-traits.tact
@@ -0,0 +1,23 @@
+primitive Int;
+
+trait BaseTrait {}
+
+trait TraitA {
+    fun f(): Int {
+        return 1;
+    }
+}
+
+trait TraitB {
+    fun f(): Int {
+        return 2;
+    }
+}
+
+trait TraitC {
+    fun f(): Int {
+        return 2;
+    }
+}
+
+contract TestContract with TraitA, TraitB, TraitC {}
diff --git a/src/types/test-failed/multi-inheritance-with-duplicate-methods-virtual-and-virtual-method.tact b/src/types/test-failed/multi-inheritance-with-duplicate-methods-virtual-and-virtual-method.tact
new file mode 100644
index 00000000..a06dff51
--- /dev/null
+++ b/src/types/test-failed/multi-inheritance-with-duplicate-methods-virtual-and-virtual-method.tact
@@ -0,0 +1,19 @@
+primitive Int;
+
+trait BaseTrait {}
+
+trait TraitA {
+    virtual fun f(): Int {
+        return 3;
+    }
+}
+
+trait TraitB {
+    virtual fun f(): Int {
+        return 2;
+    }
+}
+
+contract TestContract with TraitA, TraitB {
+    override fun f(): Int {}
+}
diff --git a/src/types/test-failed/multi-inheritance-with-duplicate-methods.tact b/src/types/test-failed/multi-inheritance-with-duplicate-methods.tact
new file mode 100644
index 00000000..4620625d
--- /dev/null
+++ b/src/types/test-failed/multi-inheritance-with-duplicate-methods.tact
@@ -0,0 +1,17 @@
+primitive Int;
+
+trait BaseTrait {}
+
+trait TraitA {
+    fun f(): Int {
+        return 1;
+    }
+}
+
+trait TraitB {
+    fun f(): Int {
+        return 2;
+    }
+}
+
+contract TestContract with TraitA, TraitB {}



Test patch:
diff --git a/src/types/test/multi-inheritance-with-duplicate-methods-via-diamond.tact b/src/types/test/multi-inheritance-with-duplicate-methods-via-diamond.tact
new file mode 100644
index 00000000..ef4bd472
--- /dev/null
+++ b/src/types/test/multi-inheritance-with-duplicate-methods-via-diamond.tact
@@ -0,0 +1,15 @@
+primitive Int;
+
+trait BaseTrait {}
+
+trait TraitA {
+    fun f(): Int {
+        return 1;
+    }
+}
+
+trait TraitB with TraitA {}
+
+trait TraitC with TraitA {}
+
+contract TestContract with TraitB, TraitC {}