# Overload === for custom type

**URL:** <https://discourse.julialang.org/t/overload-for-custom-type/4898>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 17, 2017, 10:41am UTC](https://discourse.julialang.org/t/overload-for-custom-type/4898 "2017-07-17T10:41:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [July 17, 2017, 10:41am UTC](https://discourse.julialang.org/t/overload-for-custom-type/4898/1 "2017-07-17T10:41:06Z")

</div>

I am trying to overload `===` on a custom type (as a workaround for [https://discourse.julialang.org/t/surprising-struct-equality-test](https://discourse.julialang.org/t/surprising-struct-equality-test)), but I get an error.

> cannot add methods to a builtin function

Here is some code

```julia
struct T1 s::String end
Base.:(==)(x::T1, y::T1) = x.s == y.s
Base.:(===)(x::T1, y::T1) = x == s

```

Why is this forbidden?

---

<div class="post-metadata">

**Author:** ![anon61610682](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@anon61610682](https://discourse.julialang.org/u/anon61610682)\
**Post date:** [July 17, 2017, 11:29am UTC](https://discourse.julialang.org/t/overload-for-custom-type/4898/2 "2017-07-17T11:29:21Z")

</div>

According to the [documentation](https://docs.julialang.org/en/stable/devdocs/functions/#Builtins-1), `===` and some others that are called **builtins** are _singleton_ objects. I assume adding methods to those entry points would result in undefined behaviour or side effects as Julia itself relies on the correct implementation of such functions.
