Mirror forEach not working

Hi, I'm trying to load glsl shaders for compilation but my mirror isn't doing anything

The reason I'm using a mirror here is because I want an easy way to add more shaders in one place and access them by name.

I put a breakpoint on compileShaders() and the program doesn't enter the closure, even though looking at sources using lldb tells me the data is there

I can't figure out why, everything seems ok :pensive:

    ...

    private struct ShaderSourceFiles {
        
        let basic: ShaderSources = (
            try! String(contentsOfFile: Bundle.module.path(forResource: "BasicVertex", ofType: "glsl", inDirectory: "Shaders")!),
            try! String(contentsOfFile: Bundle.module.path(forResource: "BasicFragment", ofType: "glsl", inDirectory: "Shaders")!)
        )
        
    }
    
    /// Stores shader IDs
    static var shaders: [String: ShaderProgram] = [:]
    
    /// Compiles shaders
    static func compileShaders() {
        
        let sources = ShaderSourceFiles()
        
        Mirror(reflecting: sources).children.forEach { child in
            let value = child.value as! ShaderSources
            let shader = createShader(vertex: value.vertex, fragment: value.fragment)
            shaders.updateValue(shader, forKey: child.label!)
        }
    }

    ...

Okay never mind, that still doesn't work but this:

        let sources = ShaderSourceFiles()
        
        let mirror = Mirror(reflecting: sources).children
        
        for item in mirror {
            let value = item.value as! ShaderSources
            let shader = createShader(vertex: value.vertex, fragment: value.fragment)
            shaders.updateValue(shader, forKey: item.label!)
        }

seems to be working fine for some reason.