You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[generator] Invalidate automatically generated events that will have invalid name. (#69)
Addresses https://bugzilla.xamarin.com/show_bug.cgi?id=40172
setOn123Listener(On123Listener) will generate event named 123, but that
is not a valid C# name and will result in compilation error. So check
that name, warn it, and do not generate event.
Copy file name to clipboardExpand all lines: tools/generator/InterfaceGen.cs
+14-1Lines changed: 14 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -468,6 +468,10 @@ public void GenerateEventsOrPropertiesForListener (StreamWriter sw, string inden
468
468
Report.Warning(0,Report.WarningInterfaceGen+1,"empty event name in {0}.{1}.",FullName,method.Name);
469
469
continue;
470
470
}
471
+
if(opt.GetSafeIdentifier(name)!=name){
472
+
Report.Warning(0,Report.WarningInterfaceGen+4,"event name for {0}.{1} is invalid. `eventName' or `argsType` can be used to assign a valid member name.",FullName,method.Name);
Report.Warning(0,Report.WarningInterfaceGen+5,"event name for {0}.{1} is invalid. `eventName' or `argsType` can be used to assign a valid member name.",FullName,name);
Report.Warning(0,Report.WarningInterfaceGen+6,"event property name for {0}.{1} is invalid. `eventName' or `argsType` can be used to assign a valid member name.",FullName,name);
0 commit comments