| ... | @@ -2487,7 +2487,7 @@ pub fn analyzeDeclRef(self: *Module, scope: *Scope, src: usize, decl: *Decl) Inn | ... | @@ -2487,7 +2487,7 @@ pub fn analyzeDeclRef(self: *Module, scope: *Scope, src: usize, decl: *Decl) Inn |
| 2487 | fn analyzeVarRef(self: *Module, scope: *Scope, src: usize, tv: TypedValue) InnerError!*Inst { | 2487 | fn analyzeVarRef(self: *Module, scope: *Scope, src: usize, tv: TypedValue) InnerError!*Inst { |
| 2488 | const variable = tv.val.cast(Value.Payload.Variable).?.variable; | 2488 | const variable = tv.val.cast(Value.Payload.Variable).?.variable; |
| 2489 | | 2489 | |
| 2490 | const ty = try self.singlePtrType(scope, src, variable.is_mutable, tv.ty, .One); | 2490 | const ty = try self.simplePtrType(scope, src, tv.ty, variable.is_mutable, .One); |
| 2491 | if (!variable.is_mutable and !variable.is_extern) { | 2491 | if (!variable.is_mutable and !variable.is_extern) { |
| 2492 | const val_payload = try scope.arena().create(Value.Payload.RefVal); | 2492 | const val_payload = try scope.arena().create(Value.Payload.RefVal); |
| 2493 | val_payload.* = .{ .val = variable.init }; | 2493 | val_payload.* = .{ .val = variable.init }; |
| ... | @@ -3191,7 +3191,7 @@ pub fn floatSub(self: *Module, scope: *Scope, float_type: Type, src: usize, lhs: | ... | @@ -3191,7 +3191,7 @@ pub fn floatSub(self: *Module, scope: *Scope, float_type: Type, src: usize, lhs: |
| 3191 | } | 3191 | } |
| 3192 | | 3192 | |
| 3193 | pub fn simplePtrType(self: *Module, scope: *Scope, src: usize, elem_ty: Type, mutable: bool, size: std.builtin.TypeInfo.Pointer.Size) Allocator.Error!Type { | 3193 | pub fn simplePtrType(self: *Module, scope: *Scope, src: usize, elem_ty: Type, mutable: bool, size: std.builtin.TypeInfo.Pointer.Size) Allocator.Error!Type { |
| 3194 | if (size == .Slice and elem_ty.eql(Type.initTag(.u8))) { | 3194 | if (!mutable and size == .Slice and elem_ty.eql(Type.initTag(.u8))) { |
| 3195 | return Type.initTag(.const_slice_u8); | 3195 | return Type.initTag(.const_slice_u8); |
| 3196 | } | 3196 | } |
| 3197 | // TODO stage1 type inference bug | 3197 | // TODO stage1 type inference bug |