From f45511b98361e949955c82aedb495297d1d51423 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Tue, 21 Mar 2017 17:04:17 +0100 Subject: [PATCH] Don't recreate Name instances for special resolve constructs --- .../types/expressions/ControlStructureTypingUtils.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ControlStructureTypingUtils.java b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ControlStructureTypingUtils.java index df1e9ad8898..54966aa4477 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ControlStructureTypingUtils.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ControlStructureTypingUtils.java @@ -69,9 +69,13 @@ public class ControlStructureTypingUtils { IF("if"), ELVIS("elvis"), EXCL_EXCL("ExclExcl"), WHEN("when"); private final String name; + private final Name specialFunctionName; + private final Name specialTypeParameterName; ResolveConstruct(String name) { this.name = name; + this.specialFunctionName = Name.identifier(""); + this.specialTypeParameterName = Name.identifier(""); } public String getName() { @@ -79,11 +83,11 @@ public class ControlStructureTypingUtils { } public Name getSpecialFunctionName() { - return Name.identifier(""); + return specialFunctionName; } public Name getSpecialTypeParameterName() { - return Name.identifier(""); + return specialTypeParameterName; } }