Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compiler/natives/src/reflect: Don't skip string internalization for t…
…ypes. I don't see a good reason to skip string internalization in reflect package. It was introduced as part of other changes for Go 1.7 support in commit f1514b4, but no rationale was provided. Skipping internalization is inconsistent and causes issues because string comparison no longer works as expected. Specifically, the test TestMethodByNameUnExportedFirst was failing with: got , expected ΦExported The reason it was failing is because the test makes a typ.MethodByName("ΦExported") call. Once that string is internalized, it becomes "\xCE\xA6Exported". As a result, the code in rtype.MethodByName was failing to find the method by name, because the internalized and non-internalized strings did not match: have: unexported want: ΦExported match: false have: ΦExported want: ΦExported match: false Removing this special behavior seems to not have any adverse effects, fixes the issue and makes things simpler: have: unexported want: ΦExported match: false have: ΦExported want: ΦExported match: true
- Loading branch information