InjectFix icon indicating copy to clipboard operation
InjectFix copied to clipboard

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

Open chengfengsue opened this issue 6 years ago • 4 comments

一个函数这样写没有问题 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 <PrivateImplementationDetails>/_ private int Cal(int a, int b) { int[] temp = new int[] { 1,2,3}; return a + b + temp[0]; }

chengfengsue avatar Oct 08 '19 14:10 chengfengsue

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

chexiongsheng avatar Oct 09 '19 02:10 chexiongsheng

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

chengfengsue avatar Oct 09 '19 02:10 chengfengsue

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

chexiongsheng avatar Oct 09 '19 02:10 chexiongsheng

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

xtay avatar Sep 29 '20 12:09 xtay