@@ -858,12 +858,11 @@ pub fn resolveFieldAccessBinding(analyser: *Analyser, lhs_binding: Binding, fiel
858858 .is_const = lhs_binding .is_const ,
859859 };
860860
861- if (try left_type .lookupSymbol (analyser , field_name )) | child | {
861+ if (try left_type .lookupSymbol (analyser , field_name )) | child |
862862 return .{
863863 .type = try child .resolveType (analyser ) orelse return null ,
864864 .is_const = if (left_type .is_type_val ) child .isConst () else lhs_binding .is_const ,
865865 };
866- }
867866
868867 return null ;
869868}
@@ -1718,6 +1717,7 @@ fn resolveTypeOfNodeUncached(analyser: *Analyser, options: ResolveOptions) error
17181717 .container = > | info | try info .bound_params .clone (analyser .arena ),
17191718 else = > .empty ,
17201719 };
1720+ errdefer meta_params .deinit (analyser .arena );
17211721
17221722 const has_self_param = call .ast .params .len + 1 == func_info .parameters .len and
17231723 try analyser .isInstanceCall (handle , call , func_ty );
@@ -1730,7 +1730,7 @@ fn resolveTypeOfNodeUncached(analyser: *Analyser, options: ResolveOptions) error
17301730 const param_type = param .type orelse continue ;
17311731 if (! param_type .is_type_val ) continue ;
17321732
1733- const argument_type = try analyser .resolveTypeOfNodeInternal (.of (arg , handle )) orelse continue ;
1733+ const argument_type = ( try analyser .resolveTypeOfNodeInternal (.of (arg , handle ) )) orelse continue ;
17341734 if (! argument_type .is_type_val ) continue ;
17351735
17361736 try meta_params .put (analyser .arena , .{ .token = param_name_token , .handle = func_info .handle }, argument_type );
@@ -1754,8 +1754,8 @@ fn resolveTypeOfNodeUncached(analyser: *Analyser, options: ResolveOptions) error
17541754 return Type .fromIP (analyser , .void_type , null );
17551755 }
17561756
1757- const type_expr = field .ast .type_expr .unwrap ().? ;
1758- const base_type = (try analyser .resolveTypeOfNodeInternal (.of (type_expr , handle ))) orelse return null ;
1757+ const base = field .ast .type_expr .unwrap ().? ;
1758+ const base_type = (try analyser .resolveTypeOfNodeInternal (.of (base , handle ))) orelse return null ;
17591759 return base_type .instanceTypeVal (analyser );
17601760 },
17611761 .@"comptime" ,
@@ -2900,6 +2900,7 @@ pub const Type = struct {
29002900 /// - `@compileError("")`
29012901 compile_error : NodeWithHandle ,
29022902
2903+ // `T` in `fn Foo(comptime T: type) type`
29032904 generic : TokenWithHandle ,
29042905
29052906 /// Branching types
0 commit comments