Initializer of comptime-only union 'builtin.Type' must be comptime-known?

Hi All, I am trying to upgrade my zig installation from 0.13 to 0.14, and I am now getting error " initializer of comptime-only union ‘builtin.Type’ must be comptime-known" with the following code:

inline fn objTypeOf(comptime tp:type) type {
    // construct a type with __obj_base plus the object 
    const ti = @typeInfo(tp);
    comptime std.debug.assert(ti == .pointer);
    const cti = @typeInfo(ti.pointer.child);
    const objt = struct {
        __obj_base:Object
    };
    const base_field = @typeInfo(objt).@"struct".fields;
    const new_fields = [_]std.builtin.Type.StructField{base_field[0], 
        std.builtin.Type.StructField{
            .name = "object",
            .type = @Type(cti),
            .alignment = @alignOf(tp),
            .default_value_ptr = null,
            .is_comptime = false
        },
    };
    const new_type:std.builtin.Type = .{.@"struct" = std.builtin.Type.Struct {
        .decls = &[_]std.builtin.Type.Declaration{},
        .fields = &new_fields,
        .layout = .auto,
        .is_tuple = false,
        .backing_integer = null
    }};
    return @Type(new_type);
}

it worked with 0.13 (with some field name differences), but I can’t figure out why with 0.14. any hints would be appreciated.

It would be helpful if you could post the full error. I believe this “must be comptime-known” error got a lot of explanatory notes added that should help in understanding the problem.

thanks for replying. the error was pretty verbose, similar to the error at `explainWhyTypeIsComptime` is extremely verbose · Issue #12344 · ziglang/zig · GitHub. basically I was trying to programatically construct a struct and I don’t understand what was not comptime-known in the code above.
in the meantime, I already got it working with 0.14, in an even more straightforward way IMO, by just using struct {base:Object, object:T}. I believe I tried it with 0.13 months ago and somehow it wasn’t working thus I had to work around it with the above code… anyway, all good now.