[fix] fix the bug in GenericReferenceWriter where _systemTypePattern did not properly escape the '.' in type names. This caused issues when compiler-generated anonymous types and functions contained string sequences like 'System-Int', incorrectly matching them to 'System.Int', resulting in runtime exceptions.
parent
4e172129d8
commit
f19ba3eb30
|
@ -39,7 +39,7 @@ namespace HybridCLR.Editor.AOT
|
|||
{
|
||||
_typeSimpleNameMapping.Add(e.Key.FullName, e.Value);
|
||||
}
|
||||
_systemTypePattern = new Regex(string.Join("|", _typeSimpleNameMapping.Keys.Select (k => $@"\b{k}\b")));
|
||||
_systemTypePattern = new Regex(string.Join("|", _typeSimpleNameMapping.Keys.Select (k => $@"\b{Regex.Escape(k)}\b")));
|
||||
}
|
||||
|
||||
public string PrettifyTypeSig(string typeSig)
|
||||
|
|
Loading…
Reference in New Issue