If I make a XAML file in C++/CX with 128 {x:Bind} statements, I get a compiler error:
fatal error C1061: compiler limit: blocks nested too deeply
It occurs in the GeneratedFiles code, in the .g.hpp file's Disable() method, which consists of ~128 if/else statements in a row. (Actually seems to be a limit of 123, not 128.)
The only solutions are to:
a) split up the XAML file into multiple components
b) use {Binding} instead of {x:Bind}
This would be trivial to fix via either:
- changing code generation to just use a series of if statements instead of if/else
- or, via a switch statement with ((lineNumber << 32) | (columnNumber & 0xffffffff))
It appears to work fine in C# or C++/WinRT.
A simple example: the default C++/CX UWP template, with 128 of these:
<Button Content="{x:Bind S}"/>
and a simple string property:
property Platform::String^ S {
Platform::String^ get() { return L"S"; }
}