@@ -2509,32 +2509,61 @@ protected virtual Type EvaluateType(string expression,ref int i, string currentN
25092509 Type staticType = GetTypeByFriendlyName ( typeName , genericsTypes ) ;
25102510
25112511 // For inline namespace parsing
2512- if ( staticType == null && OptionInlineNamespacesEvaluationActive )
2512+ if ( staticType == null )
25132513 {
2514- int subIndex = 0 ;
2515- Match namespaceMatch = varOrFunctionRegEx . Match ( expression . Substring ( i + subIndex ) ) ;
2516-
2517- while ( staticType == null
2518- && namespaceMatch . Success
2519- && ! namespaceMatch . Groups [ "sign" ] . Success
2520- && ! namespaceMatch . Groups [ "assignationOperator" ] . Success
2521- && ! namespaceMatch . Groups [ "postfixOperator" ] . Success
2522- && ! namespaceMatch . Groups [ "isfunction" ] . Success
2523- && i + subIndex < expression . Length
2524- && ! typeName . EndsWith ( "?" ) )
2514+ if ( OptionInlineNamespacesEvaluationActive )
25252515 {
2526- subIndex += namespaceMatch . Length ;
2527- typeName += $ "{ namespaceMatch . Groups [ "inObject" ] . Value } { namespaceMatch . Groups [ "name" ] . Value } { ( ( i + subIndex < expression . Length && expression . Substring ( i + subIndex ) [ 0 ] == '?' ) ? "?" : "" ) } ";
2516+ int subIndex = 0 ;
2517+ Match namespaceMatch = varOrFunctionRegEx . Match ( expression . Substring ( i + subIndex ) ) ;
2518+
2519+ while ( staticType == null
2520+ && namespaceMatch . Success
2521+ && ! namespaceMatch . Groups [ "sign" ] . Success
2522+ && ! namespaceMatch . Groups [ "assignationOperator" ] . Success
2523+ && ! namespaceMatch . Groups [ "postfixOperator" ] . Success
2524+ && ! namespaceMatch . Groups [ "isfunction" ] . Success
2525+ && i + subIndex < expression . Length
2526+ && ! typeName . EndsWith ( "?" ) )
2527+ {
2528+ subIndex += namespaceMatch . Length ;
2529+ typeName += $ "{ namespaceMatch . Groups [ "inObject" ] . Value } { namespaceMatch . Groups [ "name" ] . Value } { ( ( i + subIndex < expression . Length && expression . Substring ( i + subIndex ) [ 0 ] == '?' ) ? "?" : "" ) } ";
25282530
2529- staticType = GetTypeByFriendlyName ( typeName , namespaceMatch . Groups [ "isgeneric" ] . Value ) ;
2531+ staticType = GetTypeByFriendlyName ( typeName , namespaceMatch . Groups [ "isgeneric" ] . Value ) ;
25302532
2531- if ( staticType != null )
2532- {
2533- i += subIndex ;
2534- break ;
2533+ if ( staticType != null )
2534+ {
2535+ i += subIndex ;
2536+ break ;
2537+ }
2538+
2539+ namespaceMatch = varOrFunctionRegEx . Match ( expression . Substring ( i + subIndex ) ) ;
25352540 }
2541+ }
2542+ else
2543+ {
2544+ int subIndex = 0 ;
2545+ Match typeMatch = varOrFunctionRegEx . Match ( expression . Substring ( i + subIndex ) ) ;
2546+
2547+ if ( staticType == null
2548+ && typeMatch . Success
2549+ && ! typeMatch . Groups [ "sign" ] . Success
2550+ && ! typeMatch . Groups [ "assignationOperator" ] . Success
2551+ && ! typeMatch . Groups [ "postfixOperator" ] . Success
2552+ && ! typeMatch . Groups [ "isfunction" ] . Success
2553+ && ! typeMatch . Groups [ "inObject" ] . Success
2554+ && i + subIndex < expression . Length
2555+ && ! typeName . EndsWith ( "?" ) )
2556+ {
2557+ subIndex += typeMatch . Length ;
2558+ typeName += $ "{ typeMatch . Groups [ "name" ] . Value } { ( ( i + subIndex < expression . Length && expression . Substring ( i + subIndex ) [ 0 ] == '?' ) ? "?" : "" ) } ";
25362559
2537- namespaceMatch = varOrFunctionRegEx . Match ( expression . Substring ( i + subIndex ) ) ;
2560+ staticType = GetTypeByFriendlyName ( typeName , typeMatch . Groups [ "isgeneric" ] . Value ) ;
2561+
2562+ if ( staticType != null )
2563+ {
2564+ i += subIndex ;
2565+ }
2566+ }
25382567 }
25392568 }
25402569
0 commit comments