Create language .net compiler with Cecil

81 views
Skip to first unread message

cm4...@gmail.com

unread,
May 6, 2019, 12:09:39 PM5/6/19
to mono-cecil
Hi everyone! 

I'm writing the compiler prototype using Cecil as assembly builder. I'm using .net core for developing.

And I have some troubles connected with the System.Private.CoreLib reference.

In my language I can using array out of the box like this:

double Average(int[] arr)
{
 
double result = 0;

 
for(int i = 0; i < arr.Length; i++) //arr.Length <-- this is field access
 
{
 result
= result + arr[i];
 
};

 result
= result / arr.Length;
 
 
return result;
}

And then I try with cecil get the Length_get method from the mscorelib the Cecil reference to the System.Private.CoreLib. If I target .net framework then everything is fine.

I have read on github issues with problems with .net core but I didn't find the solution.

I can give small repro if need.

(I think this is related https://github.com/jbevain/cecil/issues/487)

How I can resolve this. Or for my project better use the System.Reflection namespace.

Thanks.
Reply all
Reply to author
Forward
0 new messages