New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 677166 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Jan 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 582312



Sign in to add a comment

Rewritten hash -> Hash collides with a Hash struct

Project Member Reported by lukasza@chromium.org, Dec 27 2016

Issue description

Rewritten hash -> Hash collides with a Hash struct
 
r440284 adds "hash" to the list of blacklisted method names, but this list only affects *instance* methods.
The latest proposal is to blacklist renaming of "hash" regardless of whether it is a static or instance method + also blacklist renaming if it is a standalone function - https://codereview.chromium.org/2608443002

An alternative would be to rename either the |Hash| function (but |GetHash| is not an obvious name here) or the |DetailtHash<T>::Hash| typename (also no obvious name here + manually finding and renaming all the templates is a bit tricky).  I think just skipping the rename is easier.
Cc: lukasza@chromium.org
Owner: nasko@chromium.org
Status: Fixed (was: Started)
nasko@, please reactivate if this comes back.
Cc: nasko@chromium.org
Labels: -Pri-3 Pri-2
Owner: ----
Status: Available (was: Fixed)
Aaand it is back...

If we blacklist renaming of "hash" method, then we have a problem in code generator for DOM bindings - we want the generator to consistently capitalize all method names, but this means that it will expect "Hash" as an implementation of "hash" attribute frmo Location.idl.

I am not sure what options we have at this point:

1. Preland renaming of "hash" method to something else.  "getHash"?  (this is probably slightly blocked on  issue 673039 )

2. Special case / blacklist "hash" also in the code generator?


Any option I am missing?  What do people think about "getHash" name in general?
getHash seems fine to me. I think this can be lumped in with all the other idl issues and we can use whatever general scheme here as well, unless there is something else special about "hash" that I am not seeing?
Project Member

Comment 7 by bugdroid1@chromium.org, Jan 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0020d5c9503dd59d2caf28999aa38bc600206303

commit 0020d5c9503dd59d2caf28999aa38bc600206303
Author: nasko <nasko@chromium.org>
Date: Wed Jan 04 19:17:51 2017

Update methods requiring Get prefix to avoid collisions with Blink rewrite.

This CL adds a few more methods that cause name collisions when Blink
is rewritten to match Chromium style. In addition, it removes the hash
method from the blacklist.

BUG= 582312 ,  677166 

Review-Url: https://codereview.chromium.org/2608423003
Cr-Commit-Position: refs/heads/master@{#441429}

[modify] https://crrev.com/0020d5c9503dd59d2caf28999aa38bc600206303/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
[modify] https://crrev.com/0020d5c9503dd59d2caf28999aa38bc600206303/tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc
[modify] https://crrev.com/0020d5c9503dd59d2caf28999aa38bc600206303/tools/clang/rewrite_to_chrome_style/tests/methods-original.cc

Status: Fixed (was: Available)

Sign in to add a comment