Zig: std.math.big.int.Mutable.toManaged() compile error

Created on 23 Jul 2020  路  1Comment  路  Source: ziglang/zig

I am getting a compile error when attempting to use std.math.big.int.Mutable.toManaged():

/usr/lib/zig/std/math/big/int.zig:102:22: error: use of undeclared identifier 'limbs'
            .limbs = limbs,
                    ^

The body and potential fix for std.math.big.int.Mutable.toManaged() is:

 pub fn toManaged(self: Mutable, allocator: *Allocator) Managed {
        return .{
            .allocator = allocator, 
            .limbs = limbs,  /// <--- Compile error is here.  This should be self.limbs
            .metadata = if (self.positive)
                self.len & ~Managed.sign_bit
            else
                self.len | Managed.sign_bit,
        };
    }

I am using 0.6.0+32a6759a7, but this doesn't seem to be fixed in the latest pull of the repo

bug standard library

Most helpful comment

I'd be happy to fix this bug and create test cases for toManaged.

>All comments

I'd be happy to fix this bug and create test cases for toManaged.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andrewrk picture andrewrk  路  3Comments

andrewrk picture andrewrk  路  3Comments

fengb picture fengb  路  3Comments

jayschwa picture jayschwa  路  3Comments

andersfr picture andersfr  路  3Comments