Can not create a View with generic inside an other View

I tried to create a View with generic inside an other View, and it works fine with build and run. But when I tried to review it, Xcode 15.1 showed an error.

CompileDylibError: Failed to build AView.swift Compiling failed: cannot find 'SubListView' in scope

struct AView: View {
    struct BView<T: DisplayData>: View {

    }
}

I need to move the BView out of AView to fix the issues. I think it is a preview bug as it works well on build and run.

Not sure what will possess you to do this but the language is not meant to be used like this.

Can not create a View with generic inside an other View
 
 
Q