{"record":{"id":"a687a4ff03956f1e","repo":"unoplatform/uno","slug":"invalid-type-name-list-0","errorCode":null,"errorMessage":"Invalid type name list: '{0}'","messagePattern":"Invalid type name list: '(.+?)'","errorType":"exception","errorClass":"FormatException","httpStatus":null,"severity":"error","filePath":"src/SourceGenerators/System.Xaml/System.Xaml.Schema/XamlTypeName.cs","lineNumber":105,"sourceCode":"\t\t\t\tlocal = typeName.Substring (idx + 1);\n\t\t\t\tif (!XamlLanguage.IsValidXamlName (prefix))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (!XamlLanguage.IsValidXamlName (local))\n\t\t\t\treturn false;\n\t\t\tstring ns = namespaceResolver.GetNamespace (prefix);\n\t\t\tif (ns == null)\n\t\t\t\treturn false;\n\n\t\t\tresult = new XamlTypeName (ns, local, args);\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic static IList<XamlTypeName> ParseList (string typeNameList, IXamlNamespaceResolver namespaceResolver)\n\t\t{\n\t\t\tIList<XamlTypeName> list;\n\t\t\tif (!TryParseList (typeNameList, namespaceResolver, out list))\n\t\t\t\tthrow new FormatException (String.Format (CultureInfo.InvariantCulture, \"Invalid type name list: '{0}'\", typeNameList));\n\t\t\treturn list;\n\t\t}\n\n\t\tstatic readonly char [] comma_or_parens = new char [] {',', '(', ')'};\n\n\t\tpublic static bool TryParseList (string typeNameList, IXamlNamespaceResolver namespaceResolver, out IList<XamlTypeName> result)\n\t\t{\n\t\t\tif (typeNameList == null)\n\t\t\t\tthrow new ArgumentNullException (\"typeNameList\");\n\t\t\tif (namespaceResolver == null)\n\t\t\t\tthrow new ArgumentNullException (\"namespaceResolver\");\n\n\t\t\tresult = null;\n\t\t\tint idx = 0;\n\t\t\tint parens = 0;\n\t\t\tXamlTypeName tn;\n\n\t\t\tList<string> l = new List<string> ();","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SourceGenerators/System.Xaml/System.Xaml.Schema/XamlTypeName.cs#L87-L123","documentation":"Thrown by XamlTypeName.ParseList when TryParseList returns false. ParseList is the throwing wrapper; the FormatException signals the comma-separated type-name list is malformed or contains a name that fails to parse (bad prefix, unknown namespace, mismatched brackets).","triggerScenarios":"Calling XamlTypeName.ParseList(\"ns:Foo, x:Int32\", resolver) where one element fails to parse; unbalanced parentheses in a generic argument list spanning the comma; a list element with an unmapped prefix.","commonSituations":"Parsing multi-type generic argument lists built by hand; lists assembled from user input with inconsistent prefixes; resolver missing one of the prefixes used across the list.","solutions":["Use TryParseList instead of ParseList and handle the false return with detail about which element failed.","Ensure every prefix used across all list elements is mapped in the resolver.","Validate list syntax: comma-separated `prefix:Name(args)` entries with balanced parentheses.","Parse elements individually to isolate which one is malformed."],"exampleFix":"// before\nvar list = XamlTypeName.ParseList(input, resolver);\n\n// after\nif (!XamlTypeName.TryParseList(input, resolver, out var list)) {\n    throw new FormatException($\"Cannot parse XAML type name list '{input}'; verify each element's prefix and namespace.\");\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    var list = XamlTypeName.ParseList(input, resolver);\n} catch (FormatException ex) {\n    // parse elements individually to isolate which one is malformed\n}","preventionTips":["Prefer TryParseList over ParseList.","Ensure every prefix across all list elements is mapped in the resolver.","Validate list syntax (comma-separated, balanced parentheses) before parsing."],"tags":["xaml","schema","parsing","type-name","format-exception"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}