[Pitch] Compile-Time Constant Values

I sort of see static properties on a type being the same as instance property's of the MetaType. Im aware swift does not really expose the MetaType in the same way other lanagues but I feel that the content values (and thus expressions) means swift you start to expose these. When I say MetaType im thinking about how python has meta types.

This is a short summary of what I had in mind if you think this could go somewhere I'm happy to open a seperate discussion on the forum here to see if this idea resonates with people.

Maybe swift could gain (not part of this proposal) the explicitly ability to declare meta types rathe than them currently being implicitly generated by the compiler.

eg

struct Matrix {
    const metatype<V: AdditiveArithmetic & Numeric> {
        let V: Type.self
        let n: UInt
        let m: Uint

        init(_ v: V.type, n: UInt, m: UInt) {
            self.v = v
            self.n = n
            self.m = m
        }
    }
}

with the init method of the meta type becoming the call signature of the generic specialisation.

Matrix<Float, n: 3, m: 2>

So that the compiler does not generate multiple meta types for the same signature the meta type would need to conform to equitable (or maybe washable) so the compiler could ensure it only every creates one meta type for any given combination of values. In this example the init method would be evaluated during compile time so would be an implicitly constant expression.