Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SysCall] add support to enum methods, #1169

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

Jim8y
Copy link
Contributor

@Jim8y Jim8y commented Sep 16, 2024

This pr adds a group of enum methods.

@@ -263,6 +272,8 @@ private bool TryProcessSystemMethods(SemanticModel model, IMethodSymbol symbol,
var key = symbol.ToString()!.Replace("out ", "");
key = (from parameter in symbol.Parameters let parameterType = parameter.Type.ToString() where !parameter.Type.IsValueType && parameterType!.EndsWith('?') select parameterType).Aggregate(key, (current, parameterType) => current.Replace(parameterType, parameterType[..^1]));
if (key == "string.ToString()") key = "object.ToString()";
if (key.Contains("System.Enum.GetName<")) key = "System.Enum.GetName<>()";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can not directly process this, cause the name of the method is not the same as its signature that we invokes, so i have to add direct string key.

@Jim8y Jim8y requested a review from shargon September 17, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants