{"record":{"id":"187a1bce6d65d15f","repo":"tui-cs/Terminal.Gui","slug":"view-gettype-name-name-bad-gettype-na","errorCode":null,"errorMessage":"{view.GetType ().Name}.{name} = {bad.GetType ().Name} which depends on the SuperView's dimensions and the SuperView uses Dim.Auto.","messagePattern":"(.+?)\\.(.+?) = (.+?) which depends on the SuperView's dimensions and the SuperView uses Dim\\.Auto\\.","errorType":"exception","errorClass":"LayoutException","httpStatus":null,"severity":"warning","filePath":"Terminal.Gui/ViewBase/View.Layout.cs","lineNumber":1727,"sourceCode":"                case DimFill:\n                    break;\n\n                case Dim dim and not DimAbsolute and not DimView and not DimCombine:\n                    bad = dim;\n\n                    break;\n\n                case Dim dim and DimCombine:\n                    // Recursively check for not Absolute or not View\n                    ThrowInvalid (view, (dim as DimCombine)?.Left, name);\n                    ThrowInvalid (view, (dim as DimCombine)?.Right, name);\n\n                    break;\n            }\n\n            if (bad != null)\n            {\n                throw new LayoutException ($\"{view.GetType ().Name}.{name} = {bad.GetType ().Name} \"\n                                           + $\"which depends on the SuperView's dimensions and the SuperView uses Dim.Auto.\");\n            }\n        }\n    }\n\n    #endregion Diagnostics and Verification\n}\n","sourceCodeStart":1709,"sourceCodeEnd":1735,"githubUrl":"https://github.com/tui-cs/Terminal.Gui/blob/2e47b11478db083499917f2ad27c34d30efb0df1/Terminal.Gui/ViewBase/View.Layout.cs#L1709-L1735","documentation":"This diagnostic (only active when View.ValidatePosDim is true) detects a SubView whose Width/Height/X/Y uses a Dim/Pos type (like Dim.Percent or Dim.Fill) that depends on the SuperView's dimensions, while the SuperView itself uses Dim.Auto — which derives its size FROM its SubViews. This creates a circular sizing dependency (child needs parent size, parent needs child size).","triggerScenarios":"Enabling ValidatePosDim = true on a SuperView whose Width/Height is Dim.Auto(style: Content), while a SubView uses Dim.Fill, Dim.Percent, or a non-View/absolute Pos that references the SuperView.","commonSituations":"Debugging a layout that renders at zero size or loops; turning on validation to diagnose; mixing Dim.Auto content sizing with Fill-style children that expect a fixed parent size.","solutions":["Change the SubView to Dim.Absolute or Dim.Auto so it does not depend on the SuperView's computed size.","Change the SuperView from Dim.Auto to an absolute Dim or Dim.Fill so it has an independent size.","Disable ValidatePosDim (it is a debug-only flag with a performance penalty) once you understand the issue."],"exampleFix":"// before\nparent.Width = Dim.Auto();\nchild.Width = Dim.Fill(); // circular\n// after\nparent.Width = Dim.Fill();\nchild.Width = Dim.Fill();","handlingStrategy":"validation","validationCode":"// Before enabling debug validation, ensure no SubView uses Dim.Fill/Percent under a Dim.Auto parent.\nparent.ValidatePosDim = false; // keep off in production\n// Fix: child.Width = Dim.Auto() or Dim.Absolute(n) instead of Dim.Fill()","typeGuard":"static bool IsDimAutoSafe (Dim d) => d is DimAbsolute or DimAuto or DimView or DimCombine;","tryCatchPattern":null,"preventionTips":["Keep ValidatePosDim off in production (performance penalty).","Do not combine Dim.Auto(content) SuperView with Dim.Fill/Percent children.","Use Absolute or Auto for children of content-sized parents."],"tags":["layout","dim-auto","diagnostics","circular-dependency"],"backgroundTag":null,"analyzedSha":"2e47b11478db083499917f2ad27c34d30efb0df1","analyzedAt":"2026-08-13T19:20:08.826Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}