# Intel Fortran Compiler Bug: overloading binary and unary operator(-) and use with extended types

**URL:** <https://fortran-lang.discourse.group/t/intel-fortran-compiler-bug-overloading-binary-and-unary-operator-and-use-with-extended-types/5836>\
**Category:** Uncategorized\
**Created:** [May 21, 2023, 2:23pm UTC](https://fortran-lang.discourse.group/t/intel-fortran-compiler-bug-overloading-binary-and-unary-operator-and-use-with-extended-types/5836 "2023-05-21T14:23:03Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![han190](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/han190/32/7158_2.png) [@han190](https://fortran-lang.discourse.group/u/han190)\
**Post date:** [May 21, 2023, 6:14pm UTC](https://fortran-lang.discourse.group/t/intel-fortran-compiler-bug-overloading-binary-and-unary-operator-and-use-with-extended-types/5836/5 "2023-05-21T18:14:21Z")

</div>

Because when you comment out `neg`, essentially you are just using the inherited method `diff`. “A Fortran extended type inherits all of the type parameters, components and nonoverridden, nonfinal procedure bindings from its parent type” ([Extensible derived types (Fortran 2003) - IBM Documentation](https://www.ibm.com/docs/en/xffbg/121.141?topic=types-extensible-derived-fortran-2003)). But when you do `generic :: operator(-) => diff, neg`, the generic binding is not inherited and you will have to define your `operator(-)` for the extended type as well. I suggest you read @FortranFan’s answer in [Custom operators in extended type - Help - Fortran Discourse (fortran-lang.discourse.group)](https://fortran-lang.discourse.group/t/custom-operators-in-extended-type/1083).

---

_[View the full topic](https://fortran-lang.discourse.group/t/intel-fortran-compiler-bug-overloading-binary-and-unary-operator-and-use-with-extended-types/5836)._
