I modified a test to reproduce this issue
test_component.txt - please rename it .txt -> .idl , it is the correspondent to this file https://github.com/microsoft/cppwinrt/blob/master/test/test_component/test_component.idl
The problem:
The below structures cannot be built, the compiler yelds error C2139: 'winrt::test_component::B': an undefined class is not allowed as an argument to compiler intrinsic type trait '__is_trivially_destructible' (compiling source file Simple.cpp)
Swapping the names (A <-> B) solves the problem.
struct B
{
Single a1;
Windows.Foundation.IReference<Single> a2;
};
struct A
{
Windows.Foundation.IReference<B> a1;
};