{"record":{"id":"ad2e3d902027c29c","repo":"unoplatform/uno","slug":"xamltype","errorCode":null,"errorMessage":"xamlType","messagePattern":"xamlType","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/SourceGenerators/System.Xaml/System.Xaml.Schema/XamlTypeName.cs","lineNumber":200,"sourceCode":"\t\t\t\tret += ta.ToString (prefixLookup);\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\n\t\t// instance members\n\n\t\tpublic XamlTypeName ()\n\t\t{\n\t\t\tTypeArguments = empty_type_args;\n\t\t}\n\n\t\tstatic readonly XamlTypeName [] empty_type_args = Array.Empty<XamlTypeName>();\n\n\t\tpublic XamlTypeName (XamlType xamlType)\n\t\t\t: this ()\n\t\t{\n\t\t\tif (xamlType == null)\n\t\t\t\tthrow new ArgumentNullException (\"xamlType\");\n\t\t\tNamespace = xamlType.PreferredXamlNamespace;\n\t\t\tName = xamlType.Name;\n\t\t\tif (xamlType.TypeArguments != null && xamlType.TypeArguments.Count > 0) {\n\t\t\t\tvar l = new List<XamlTypeName> ();\n\t\t\t\tl.AddRange (xamlType.TypeArguments.Select (x => new XamlTypeName (x)));\n\t\t\t\tTypeArguments = l;\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic XamlTypeName (string xamlNamespace, string name)\n\t\t\t: this (xamlNamespace, name, null)\n\t\t{\n\t\t}\n\n\t\tpublic XamlTypeName (string xamlNamespace, string name, IEnumerable<XamlTypeName> typeArguments)\n\t\t\t: this ()\n\t\t{\n\t\t\tNamespace = xamlNamespace;","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SourceGenerators/System.Xaml/System.Xaml.Schema/XamlTypeName.cs#L182-L218","documentation":"Thrown by the XamlTypeName(XamlType xamlType) constructor when `xamlType` is null. The constructor copies the XamlType's PreferredXamlNamespace, Name, and TypeArguments into the new XamlTypeName, so a null source has nothing to copy; it is rejected immediately.","triggerScenarios":"Calling new XamlTypeName(null); or new XamlTypeName(resolvedType) where resolvedType is null from a failed GetXamlType lookup.","commonSituations":"Type-resolution failures where GetXamlType returns null and the null propagates into XamlTypeName construction; code that assumes a type was always resolved.","solutions":["Null-check the XamlType before constructing the XamlTypeName.","Fix the upstream type resolution so GetXamlType returns a non-null XamlType (verify assembly references and xmlns mappings).","Construct XamlTypeName from explicit (namespace, name) strings instead when you only have partial type info."],"exampleFix":"// before\nvar name = new XamlTypeName(resolvedType); // resolvedType may be null\n\n// after\nif (resolvedType == null) {\n    throw new InvalidOperationException(\"Could not resolve XamlType for type-name construction.\");\n}\nvar name = new XamlTypeName(resolvedType);","handlingStrategy":"validation","validationCode":"// before constructing\nif (xamlType == null) throw new InvalidOperationException(\"XamlType resolution returned null; cannot build XamlTypeName.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify type resolution succeeded (non-null GetXamlType result) before constructing a XamlTypeName.","When only partial info is available, build XamlTypeName from explicit (namespace, name) strings."],"tags":["xaml","schema","type-name","argument-validation","type-resolution"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}