@@ -498,6 +498,7 @@ void SetGenericArgumentCount(int count)
498498
499499 void MergeNested ( ClrTypeSpec nestedSpec )
500500 {
501+ _assemblyName = nestedSpec . AssemblyName ;
501502
502503 // Append all nested names to the current type
503504 if ( _nested == null )
@@ -550,7 +551,7 @@ public static ClrTypeSpec Parse(string typeName)
550551 return res ;
551552 }
552553
553- static ClrTypeSpec Parse ( string name , ref int p , bool is_recurse , bool allow_aqn , bool allow_mods )
554+ static ClrTypeSpec Parse ( string name , ref int p , bool is_recurse , bool allow_aqn , bool junk )
554555 {
555556 // Invariants:
556557 // - On exit p, is updated to pos the current unconsumed character.
@@ -626,22 +627,12 @@ static ClrTypeSpec Parse(string name, ref int p, bool is_recurse, bool allow_aqn
626627 switch ( name [ pos ] )
627628 {
628629 case '&' :
629- if ( ! allow_mods )
630- {
631- p = pos ;
632- return data ;
633- }
634630 if ( data . _isByRef )
635631 throw new ArgumentException ( "Can't have a byref of a byref" , "typeName" ) ;
636632
637633 data . _isByRef = true ;
638634 break ;
639635 case '*' :
640- if ( ! allow_mods )
641- {
642- p = pos ;
643- return data ;
644- }
645636 if ( data . _isByRef )
646637 throw new ArgumentException ( "Can't have a pointer to a byref type" , "typeName" ) ;
647638 // take subsequent '*'s too
@@ -654,11 +645,6 @@ static ClrTypeSpec Parse(string name, ref int p, bool is_recurse, bool allow_aqn
654645 data . AddModifier ( new ClrPointerSpec ( pointer_level ) ) ;
655646 break ;
656647 case ',' :
657- if ( ! allow_mods )
658- {
659- p = pos ;
660- return data ;
661- }
662648 if ( is_recurse && allow_aqn )
663649 {
664650 int end = pos ;
@@ -737,19 +723,15 @@ static ClrTypeSpec Parse(string name, ref int p, bool is_recurse, bool allow_aqn
737723 pos += 2 ; // skip "]+" to the start of the nested name
738724 var nested = Parse ( name , ref pos , true , false , true ) ;
739725 data . MergeNested ( nested ) ;
726+ if ( is_recurse )
727+ // We are going to loop and increment pos, but we haven't yet dealt with the character that ended our nested.
728+ // Decrement pos so the loop increment will get us back to this place.
729+ -- pos ;
740730 }
741731 }
742732 else
743733 { //array spec
744734
745- if ( ! allow_mods )
746- {
747- // We have an array spec (a mod) and we are not allowing mods
748- // Backup to the position of the [ and get us out of here.
749- p = pos_cache ;
750- return data ;
751- }
752-
753735 int dimensions = 1 ;
754736 bool bound = false ;
755737 while ( pos < name . Length && name [ pos ] != ']' )
0 commit comments