Skip to content

Commit 906bd84

Browse files
committed
1342 Renamed generated code parameter to avoid shadowing.
1 parent f864c74 commit 906bd84

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

source/reflect.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3617,7 +3617,7 @@ std::string to_string_impl{" to_string_impl: (this, prefix: std::string_view"
36173617
CPP2_UFCS(add_member)(t, " to_code : (this) -> std::string = to_string_impl( \"" + cpp2::to_string(CPP2_UFCS(name)(t)) + "::\" );");
36183618
}
36193619
{
3620-
std::string from_string{" from_string: (s: std::string_view) -> " + cpp2::to_string(CPP2_UFCS(name)(t)) + " = { \n"};
3620+
std::string from_string{" from_string: (cpp2_s__: std::string_view) -> " + cpp2::to_string(CPP2_UFCS(name)(t)) + " = { \n"};
36213621

36223622
// Provide a 'from_string' function to parse strings into enumerators
36233623

@@ -3634,11 +3634,11 @@ std::string from_string{" from_string: (s: std::string_view) -> " + cpp2::to_
36343634

36353635
from_string += " ret := none;\n"
36363636
" outer: do {\n"
3637-
" for cpp2::string_util::split_string_list(s) do (x) {\n";
3637+
" for cpp2::string_util::split_string_list(cpp2_s__) do (x) {\n";
36383638
}
36393639
// Otherwise, accept just a single string
36403640
else {
3641-
from_string += " x := s;\n";
3641+
from_string += " x := cpp2_s__;\n";
36423642
}
36433643
{
36443644
std::string_view else_{""};
@@ -3659,7 +3659,7 @@ std::string_view else_{""};
36593659
" } while false;\n";
36603660
}
36613661

3662-
from_string += " cpp2::type_safety.report_violation( (\"can't convert string '\" + cpp2::to_string(s) + \"' to " + cpp2::to_string(cpp2::move(prefix)) + "enum of type " + cpp2::to_string(CPP2_UFCS(name)(t)) + "\").c_str() );\n"
3662+
from_string += " cpp2::type_safety.report_violation( (\"can't convert string '\" + cpp2::to_string(cpp2_s__) + \"' to " + cpp2::to_string(cpp2::move(prefix)) + "enum of type " + cpp2::to_string(CPP2_UFCS(name)(t)) + "\").c_str() );\n"
36633663
" return " + cpp2::to_string(cpp2::move(default_value)) + ";\n"
36643664
" }\n\n";
36653665

@@ -3668,7 +3668,7 @@ std::string_view else_{""};
36683668
}
36693669

36703670
#line 1652 "reflect.h2"
3671-
CPP2_UFCS(add_member)(t, " from_code: (s: std::string_view) -> " + cpp2::to_string(CPP2_UFCS(name)(t)) + " = { str: std::string = s; return from_string( cpp2::string_util::replace_all(str, \"" + cpp2::to_string(CPP2_UFCS(name)(t)) + "::\", \"\" ) ); }");
3671+
CPP2_UFCS(add_member)(t, " from_code: (cpp2_s__: std::string_view) -> " + cpp2::to_string(CPP2_UFCS(name)(t)) + " = { str: std::string = cpp2_s__; return from_string( cpp2::string_util::replace_all(str, \"" + cpp2::to_string(CPP2_UFCS(name)(t)) + "::\", \"\" ) ); }");
36723672
}
36733673

36743674
#line 1656 "reflect.h2"

0 commit comments

Comments
 (0)