summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2020-01-22 11:33:41 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2020-01-22 14:44:08 +0900
commit700d87b3709c5eeb6fa7a238b24ae93e6fad4d68 (patch)
treea98c44c84ff80044581bbe188267b73ec8f6bf1c /src/bin
parentcade1b3c3ccacf9f47f5aeb366f5686eff232f6c (diff)
Revert "efl_mono: remove class ExtensionTag"
Extension Methods' classes have methods with same names and parameters. e.g. Text<T>(this Efl.Ui.ItemFactory<T> fac) Although the where clause contains different classes, they cannot be identified as different methods by C# compiler. e.g. Text<T>(this Efl.Ui.ItemFactory<T> fac) where T : Efl.Ui.Button e.g. Text<T>(this Efl.Ui.ItemFactory<T> fac) where T : Efl.Ui.Check As a result, to avoid ambiguous methods, ExtensionTag should be used as a second parameter of each method. e.g. Text<T>(this Efl.Ui.ItemFactory<T> fac, ExtensionTag<Efl.Ui.Button, T>magic = null) where T : Efl.Ui.Button e.g. Text<T>(this Efl.Ui.ItemFactory<T> fac, ExtensionTag<Efl.Ui.Check, T>magic = null) where T : Efl.Ui.Check This reverts commit 76631f502a8234c04ed8124bfdebe62ed5bdf954.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_definition.hh10
-rw-r--r--src/bin/eolian_mono/eolian/mono/part_definition.hh5
2 files changed, 9 insertions, 6 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh
index fcc8a88..3c30cdd 100644
--- a/src/bin/eolian_mono/eolian/mono/function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh
@@ -284,8 +284,9 @@ struct property_extension_method_definition_generator
284 if (property.setter.is_engaged()) 284 if (property.setter.is_engaged())
285 { 285 {
286 attributes::type_def prop_type = property.setter->parameters[0].type; 286 attributes::type_def prop_type = property.setter->parameters[0].type;
287 if (!as_generator(scope_tab(2) << "public static Efl.BindableProperty<" << type(true) << "> " << managed_name << "<T>(this Efl.Ui.ItemFactory<T> fac) where T : " 287 if (!as_generator(scope_tab(2) << "public static Efl.BindableProperty<" << type(true) << "> " << managed_name << "<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<"
288 << name_helpers::klass_full_concrete_or_interface_name(cls) << " {\n" 288 << name_helpers::klass_full_concrete_or_interface_name(cls)
289 << ", T>magic = null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << " {\n"
289 << scope_tab(2) << scope_tab << "return new Efl.BindableProperty<" << type(true) << ">(\"" << property.name << "\", fac);\n" 290 << scope_tab(2) << scope_tab << "return new Efl.BindableProperty<" << type(true) << ">(\"" << property.name << "\", fac);\n"
290 << scope_tab(2) << "}\n\n" 291 << scope_tab(2) << "}\n\n"
291 ).generate(sink, std::make_tuple(prop_type, prop_type), context)) 292 ).generate(sink, std::make_tuple(prop_type, prop_type), context))
@@ -300,8 +301,9 @@ struct property_extension_method_definition_generator
300 if (property.setter.is_engaged()) 301 if (property.setter.is_engaged())
301 { 302 {
302 attributes::type_def prop_type = property.setter->parameters[0].type; 303 attributes::type_def prop_type = property.setter->parameters[0].type;
303 if (!as_generator(scope_tab(2) << "public static Efl.BindableProperty<" << type(true) << "> " << managed_name << "<T>(this Efl.BindablePart<T> part) where T : " 304 if (!as_generator(scope_tab(2) << "public static Efl.BindableProperty<" << type(true) << "> " << managed_name << "<T>(this Efl.BindablePart<T> part, Efl.Csharp.ExtensionTag<"
304 << name_helpers::klass_full_concrete_or_interface_name(cls) << " {\n" 305 << name_helpers::klass_full_concrete_or_interface_name(cls)
306 << ", T>magic = null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << " {\n"
305 << scope_tab(2) << scope_tab << "Contract.Requires(part != null, nameof(part));\n" 307 << scope_tab(2) << scope_tab << "Contract.Requires(part != null, nameof(part));\n"
306 << scope_tab(2) << scope_tab << "return new Efl.BindableProperty<" << type(true) << ">(part.PartName, \"" << property.name << "\", part.Binder);\n" 308 << scope_tab(2) << scope_tab << "return new Efl.BindableProperty<" << type(true) << ">(part.PartName, \"" << property.name << "\", part.Binder);\n"
307 << scope_tab(2) << "}\n\n" 309 << scope_tab(2) << "}\n\n"
diff --git a/src/bin/eolian_mono/eolian/mono/part_definition.hh b/src/bin/eolian_mono/eolian/mono/part_definition.hh
index d87b0b5..4facf27 100644
--- a/src/bin/eolian_mono/eolian/mono/part_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/part_definition.hh
@@ -70,8 +70,9 @@ struct part_extension_method_definition_generator
70 bindableClass = "Efl.BindableFactoryPart"; 70 bindableClass = "Efl.BindableFactoryPart";
71 71
72 if (!as_generator( 72 if (!as_generator(
73 scope_tab(2) << "public static " << bindableClass << "<" << part_klass_name << "> " << name_helpers::managed_part_name(part) << "<T>(this Efl.Ui.ItemFactory<T> fac) where T : " 73 scope_tab(2) << "public static " << bindableClass << "<" << part_klass_name << "> " << name_helpers::managed_part_name(part) << "<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<"
74 << name_helpers::klass_full_concrete_or_interface_name(cls) << "\n" 74 << name_helpers::klass_full_concrete_or_interface_name(cls)
75 << ", T> x=null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << "\n"
75 << scope_tab(2) << "{\n" 76 << scope_tab(2) << "{\n"
76 << scope_tab(2) << scope_tab << "return new " << bindableClass << "<" << part_klass_name << ">(\"" << part.name << "\", fac);\n" 77 << scope_tab(2) << scope_tab << "return new " << bindableClass << "<" << part_klass_name << ">(\"" << part.name << "\", fac);\n"
77 << scope_tab(2) << "}\n\n" 78 << scope_tab(2) << "}\n\n"