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

如果一个函数内有new int[]{1,2,3}类操作,会报Warning: not support il[IL_0008: ldtoken <PrivateImplementationDetails>/_ #24

Open
chengfengsue opened this issue Oct 8, 2019 · 4 comments

Comments

@chengfengsue
Copy link

一个函数这样写没有问题
private int Cal(int a, int b)
{
//int[] temp = new int[] { 1,2,3};
return a + b;// + temp[0];
}
这样写就会报Warning: not support il[IL_0008: ldtoken /_
private int Cal(int a, int b)
{
int[] temp = new int[] { 1,2,3};
return a + b + temp[0];
}

@chexiongsheng
Copy link
Collaborator

chexiongsheng commented Oct 9, 2019

你要这样写
int a = 1;
int b = 2;
int c = 3;
int[] temp = new int[] { a,b,c};

@chengfengsue
Copy link
Author

有很多种写法,可以绕开,但是这咱要求不合理啊

@chexiongsheng
Copy link
Collaborator

修复的时候临时那样写下。过后你用正常写法就行了。

@xtay
Copy link

xtay commented Sep 29, 2020

土问为啥不能写new int[] {1, 2, 3}?
我试了一下写new string[] {"Hello", "World", "!!!"}是可以patch的,好神奇。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants