Merge pull request #2841 from lambdageek/dev/bug-40060
authormonojenkins <jo.shields+jenkins@xamarin.com>
Thu, 7 Apr 2016 00:34:46 +0000 (01:34 +0100)
committermonojenkins <jo.shields+jenkins@xamarin.com>
Thu, 7 Apr 2016 00:34:46 +0000 (01:34 +0100)
commit895071150a68b0a1d704f3b99ac90ee288f6e792
tree0684ce9958f71bfdd33260c33a9f29cb06a44bd0
parent9444d475a4db5f1f6af1bc4d9955a83ce1be5484
parente915178746d1856bb74c823d77256c6627af1802
Merge pull request #2841 from lambdageek/dev/bug-40060

[corlib] Type.GetType parser and resolver improvements

We have two type parsers the one invoked by `Type.GetType(string)` (and some others) which is implemented in C in `reflection.c`, and the one invoked by `Type.GetType(string, Func<...>, Func<...>)` implemented in managed code as `System.TypeSpec`.

In both cases `string→Type` conversion goes in two stages: parsing and resolution.  Parsing just changes the string into an AST.  And resolution crawls the AST and constructs the appropriate types.

This fixes [Bugzilla #40060](https://bugzilla.xamarin.com/show_bug.cgi?id=40060)

1. Fix the resolver on the native side for types like `"System.Generic.Collections.Dictionary[System.Int32,MyType]"` where the generic type is from corlib and a type argument is from the current assembly.
2. Fix `get_caller_no_reflection` to work correctly when the call stack has a System.Reflection method as the immediate caller of the icall.
3. Fix the resolver on the native side to work when it's called from corlib's System namespace, not just System.Reflection.
4. Fix the managed parser to work with types like `"MyGeneric[MyType]"` where the generic argument is not an assembly qualified name or there's a mixture of aqn and non-aqn type arguments.  Also rationalize how the code handles assembly qualification in general.
5. Test cases
mono/mini/debugger-agent.c