Skip to content

Conversation

@atsushieno
Copy link
Contributor

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.

@jonpryor
Copy link
Contributor

So check that name, warn it, and do not generate event.

Should we skip it, and not rename it? We could e.g. prefix with _.

@atsushieno
Copy link
Contributor Author

Keep it consistent with existing behavior to not bring API changes to customers, as long as it is possible.

continue;
}
if (opt.GetSafeIdentifier (name) != name) {
Report.Warning (0, Report.WarningInterfaceGen + 4, "event name for {0}.{1} is invalid.", FullName, method.Name);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning message should include a way to "fix" the warning, e.g. by explicitly naming it (what's the attribute?).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good point.

@atsushieno
Copy link
Contributor Author

Actually it is fixing only one part of the problem: eventName. Method name also needs check (that can be fixed with argsType).

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.
@atsushieno atsushieno force-pushed the generator-strict-event-name-check branch from fd7c7b7 to e118a46 Compare September 1, 2016 16:13
@jonpryor jonpryor merged commit bc8f02b into dotnet:master Sep 9, 2016
jonpryor pushed a commit that referenced this pull request Jan 31, 2020
Changes: dotnet/android-tools@66d445c...bfb66f3

Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/826178
Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/938504
Context: http://feedback.devdiv.io/606218

  * dotnet/android-tools@bfb66f3: Update to sdk-style csproj and netstandard2.0. (#78)
  * dotnet/android-tools@9f4ed4b: Use %ProgramW6432% path for 32-bit apps (#75)
  * dotnet/android-tools@294f447: Merge pull request #77 from xamarin/dev/soch/fix_certs
  * dotnet/android-tools@131bb29: Fix authenticode certs
  * dotnet/android-tools@962c486: Prevent NRE when Android SDK is not found (#73)
  * dotnet/android-tools@9b03310: [Windows] check %JAVA_HOME% for locating Jdk (#74)
  * dotnet/android-tools@cb41333: Get OpenJDK from well-known paths, not just registry (#72)
  * dotnet/android-tools@53ffdae: Downgrade to net46 for compatibility with VS2017+(#69)
  * dotnet/android-tools@4264703: Add AlternateIds for 9.0
  * dotnet/android-tools@90a6e06: [Xamarin.Android.Tools.AndroidSdk] Add 9.0 to KnownVersions.
  * dotnet/android-tools@4f717b6: Check if the path exists before trying to enumerate it. (#67)

Had to add an explicit NuGet restore to build it on Windows because 🤷‍♂.
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants