diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-18 03:08:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-18 03:08:09 +0300 |
commit | 2a65a97e12a0754b9f0d91ee996a6e61e00c80c8 (patch) | |
tree | f439c93cc95a324ba7422b0b650431a628be9b07 /doc/development/utilities.md | |
parent | 2d96e61ceb1a3f26283dfba43f85d99488752296 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development/utilities.md')
-rw-r--r-- | doc/development/utilities.md | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/doc/development/utilities.md b/doc/development/utilities.md index 25869a0d2b5..68851f4d550 100644 --- a/doc/development/utilities.md +++ b/doc/development/utilities.md @@ -53,7 +53,7 @@ Refer to <https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/utils/over - This utility can help you check if one method would override another or not. It is the same concept as Java's `@Override` annotation - or Scala's `override` keyword. However, you should only do this check when + or Scala's `override` keyword. However, we only run this check when `ENV['STATIC_VERIFICATION']` is set to avoid production runtime overhead. This is useful for checking: @@ -94,6 +94,15 @@ Refer to <https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/utils/over end ``` + Note that the check will only happen when either: + + - The overriding method is defined in a class, or: + - The overriding method is defined in a module, and it's prepended to + a class or a module. + + Because only a class or prepended module can actually override a method. + Including or extending a module into another cannot override anything. + ## `StrongMemoize` Refer to <https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/utils/strong_memoize.rb>: |