Skip to content

[bug] Unpacking array fails #197

Closed
@mrodz

Description

Documentation Status

Snippet Responsible

class ConditionFactory {
        valid_inputs: [[int, str]...]

        constructor(self) {
                self.valid_inputs = []
        }

        fn with_input(self, number: int, repr: str) -> Self {
                self.valid_inputs.push([number, repr])
                return self
        }

        fn len(self) -> int {
                return self.valid_inputs.len()
        }

        fn nth(self, index: int) -> [int, str] {
                return (self.valid_inputs)[index]
        }
}

class FizzBuzzFactory {
        conditions: [ConditionFactory...]

        constructor(self) {
                self.conditions = []
        }

        fn with_condition(self, condition_factory: ConditionFactory) -> Self {
                self.conditions.push(condition_factory)
                return self
        }

        fn build(self) -> (fn(int) -> str) {
                return fn(input: int) -> str {
                        result = ""
                        from 0 to self.conditions.len(), i {
                                conditions = (self.conditions)[i]

                                from 0 to conditions.len(), j {
                                        [number, repr] = conditions.nth(j)

                                        if input % number == 0 {
                                                result += repr
                                        }
                                }
                        }
                        return result
                }
        }
}

Stack Trace of Error

[ Trace ] INIT Virtual Stack at MODULE
[00:00:00] Parsing (./fizzbuzz.ms):   Done in 1.206ms
[ Debug ] pre-walk ".\\fizzbuzz.ms"
[00:00:00] Validating (./fizzbuzz.ms): /
[ Debug ] registering new file ".\\fizzbuzz.ms" (File { declarations: RefCell { value: [] }, location: ".\\fizzbuzz.mmm", exports: RefCell { value: [] }, public_types: RefCell { value: {} }, compiled: CompilationLock(Cell { value: false }) }) -- Adding to: []
[ Trace ] Virtual Stack PUSH: Class <UNKNOWN> -> No
[ Trace ] + valid_inputs: [[int, str]...]
[ Trace ] + number: int
[ Trace ] + repr: str
[ Trace ] + with_input: fn(int, str) -> Self
[ Trace ] + len: fn() -> int
[ Trace ] + index: int
[ Trace ] + nth: fn(int) -> [int, str]
[ Trace ] Virtual Stack POP
[ Trace ] in scope Module, adding type ConditionFactory = ConditionFactory
[ Trace ] Virtual Stack PUSH: Class <UNKNOWN> -> No
[ Trace ] + conditions: [ConditionFactory...]
[ Trace ] + condition_factory: ConditionFactory
[ Trace ] + with_condition: fn(ConditionFactory) -> Self
[ Trace ] + build: fn() -> (fn(int) -> str)
[ Trace ] Virtual Stack POP
[ Trace ] in scope Module, adding type FizzBuzzFactory = FizzBuzzFactory
[ Info ] DONE preloading module .\fizzbuzz.ms
[ Info ] + mod "./fizzbuzz.ms" ModuleType { exported_members: RefCell { value: [] }, public_types: RefCell { value: {} }, name: ".\\fizzbuzz.ms" }
[ Info ] + finished preload of ".\\fizzbuzz.ms"
[ Trace ] Virtual Stack PUSH: Class <UNKNOWN> -> No
[ Trace ] + valid_inputs: [[int, str]...]
[ Trace ] + number: int
[ Trace ] + repr: str
[ Trace ] + with_input: fn(int, str) -> Self
[ Trace ] + len: fn() -> int
[ Trace ] + index: int
[ Trace ] + nth: fn(int) -> [int, str]
[ Trace ] + ConditionFactory: ConditionFactory
[ Trace ] class ConditionFactory { ... }
[ Trace ] + valid_inputs: [[int, str]...]
[ Debug ] ++ valid_inputs used to have type [[int, str]...], but now it has type [[int, str]...]
[ Trace ] Virtual Stack PUSH: fn(???) -> Void
[ Trace ] + self: Self
[ Debug ] lhs:List(Mixed([])) rhs:List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))])))) f:TypecheckFlags { executing_class: Some(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] }), lhs_allow_optional_unwrap: true, force_rhs_to_be_unwrapped_lhs: false, signature_check: false, enforce_str_comptime_len_if_present: false }
[ Trace ] Virtual Stack POP
[ Trace ] Virtual Stack PUSH: fn(???) -> Should(ClassSelf(Some(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })))
[ Trace ] + self: Self
[ Trace ] + number: int
[ Trace ] + repr: str
[ Debug ] lhs:List(Mixed([Native(Int), Native(Str(StrWrapper(None)))])) rhs:List(Mixed([Native(Int), Native(Str(StrWrapper(None)))])) f:TypecheckFlags { executing_class: Some(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] }), lhs_allow_optional_unwrap: false, force_rhs_to_be_unwrapped_lhs: false, signature_check: false, enforce_str_comptime_len_if_present: false }
[ Debug ] lhs:Native(Int) rhs:Native(Int) f:TypecheckFlags { executing_class: None, lhs_allow_optional_unwrap: false, force_rhs_to_be_unwrapped_lhs: false, signature_check: false, enforce_str_comptime_len_if_present: false }
[ Debug ] lhs:Native(Str(StrWrapper(None))) rhs:Native(Str(StrWrapper(None))) f:TypecheckFlags { executing_class: None, lhs_allow_optional_unwrap: false, force_rhs_to_be_unwrapped_lhs: false, signature_check: false, enforce_str_comptime_len_if_present: false }
[ Debug ] lhs:ClassSelf(Some(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })) rhs:ClassSelf(Some(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })) f:TypecheckFlags { executing_class: Some(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] }), lhs_allow_optional_unwrap: true, force_rhs_to_be_unwrapped_lhs: false, signature_check: false, enforce_str_comptime_len_if_present: false }
[ Trace ] Virtual Stack POP
[ Trace ] Virtual Stack PUSH: fn(???) -> Should(Native(Int))
[ Trace ] + self: Self
[ Debug ] lhs:Native(Int) rhs:Native(Int) f:TypecheckFlags { executing_class: Some(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] }), lhs_allow_optional_unwrap: true, force_rhs_to_be_unwrapped_lhs: false, signature_check: false, enforce_str_comptime_len_if_present: false }
[ Trace ] Virtual Stack POP
[ Trace ] Virtual Stack PUSH: fn(???) -> Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))])))
[ Trace ] + self: Self
[ Trace ] + index: int
[ Debug ] lhs:List(Mixed([Native(Int), Native(Str(StrWrapper(None)))])) rhs:List(Mixed([Native(Int), Native(Str(StrWrapper(None)))])) f:TypecheckFlags { executing_class: Some(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] }), lhs_allow_optional_unwrap: true, force_rhs_to_be_unwrapped_lhs: false, signature_check: false, enforce_str_comptime_len_if_present: false }
[ Debug ] lhs:Native(Int) rhs:Native(Int) f:TypecheckFlags { executing_class: None, lhs_allow_optional_unwrap: false, force_rhs_to_be_unwrapped_lhs: false, signature_check: false, enforce_str_comptime_len_if_present: false }
[ Debug ] lhs:Native(Str(StrWrapper(None))) rhs:Native(Str(StrWrapper(None))) f:TypecheckFlags { executing_class: None, lhs_allow_optional_unwrap: false, force_rhs_to_be_unwrapped_lhs: false, signature_check: false, enforce_str_comptime_len_if_present: false }
[ Trace ] Virtual Stack POP
[ Trace ] Virtual Stack POP
[ Trace ] in scope Module, adding type ConditionFactory = ConditionFactory
[ Trace ] + ConditionFactory: ConditionFactory
[ Trace ] Virtual Stack PUSH: Class <UNKNOWN> -> No
[ Trace ] + conditions: [ConditionFactory...]
[ Trace ] + condition_factory: ConditionFactory
[ Trace ] + with_condition: fn(ConditionFactory) -> Self
[ Trace ] + build: fn() -> (fn(int) -> str)
[ Trace ] + FizzBuzzFactory: FizzBuzzFactory
[ Trace ] class FizzBuzzFactory { ... }
[ Trace ] + conditions: [ConditionFactory...]
[ Debug ] ++ conditions used to have type [ConditionFactory...], but now it has type [ConditionFactory...]
[ Trace ] Virtual Stack PUSH: fn(???) -> Void
[ Trace ] + self: Self
[ Debug ] lhs:List(Mixed([])) rhs:List(Open(Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] }))) f:TypecheckFlags { executing_class: Some(ClassType { name: "FizzBuzzFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "conditions", ty: Some(List(Open(Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_condition", ty: Some(Function(FunctionType { parameters: TypesOnly([Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })]), return_type: RefCell { value: Did(Class(<self referential class FizzBuzzFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "build", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(Native(Str(StrWrapper(None)))) }, is_associated_fn: false, is_constructor: false })) }, is_associated_fn: true, is_constructor: false })), read_only: false }] }), lhs_allow_optional_unwrap: true, force_rhs_to_be_unwrapped_lhs: false, signature_check: false, enforce_str_comptime_len_if_present: false }
[ Trace ] Virtual Stack POP
[ Trace ] Virtual Stack PUSH: fn(???) -> Should(ClassSelf(Some(ClassType { name: "FizzBuzzFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "conditions", ty: Some(List(Open(Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_condition", ty: Some(Function(FunctionType { parameters: TypesOnly([Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })]), return_type: RefCell { value: Did(Class(<self referential class FizzBuzzFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "build", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(Native(Str(StrWrapper(None)))) }, is_associated_fn: false, is_constructor: false })) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })))
[ Trace ] + self: Self
[ Trace ] + condition_factory: ConditionFactory
[ Debug ] lhs:Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] }) rhs:Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] }) f:TypecheckFlags { executing_class: Some(ClassType { name: "FizzBuzzFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "conditions", ty: Some(List(Open(Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_condition", ty: Some(Function(FunctionType { parameters: TypesOnly([Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })]), return_type: RefCell { value: Did(Class(<self referential class FizzBuzzFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "build", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(Native(Str(StrWrapper(None)))) }, is_associated_fn: false, is_constructor: false })) }, is_associated_fn: true, is_constructor: false })), read_only: false }] }), lhs_allow_optional_unwrap: false, force_rhs_to_be_unwrapped_lhs: false, signature_check: false, enforce_str_comptime_len_if_present: false }
[ Debug ] lhs:ClassSelf(Some(ClassType { name: "FizzBuzzFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "conditions", ty: Some(List(Open(Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_condition", ty: Some(Function(FunctionType { parameters: TypesOnly([Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })]), return_type: RefCell { value: Did(Class(<self referential class FizzBuzzFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "build", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(Native(Str(StrWrapper(None)))) }, is_associated_fn: false, is_constructor: false })) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })) rhs:ClassSelf(Some(ClassType { name: "FizzBuzzFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "conditions", ty: Some(List(Open(Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_condition", ty: Some(Function(FunctionType { parameters: TypesOnly([Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })]), return_type: RefCell { value: Did(Class(<self referential class FizzBuzzFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "build", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(Native(Str(StrWrapper(None)))) }, is_associated_fn: false, is_constructor: false })) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })) f:TypecheckFlags { executing_class: Some(ClassType { name: "FizzBuzzFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "conditions", ty: Some(List(Open(Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_condition", ty: Some(Function(FunctionType { parameters: TypesOnly([Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })]), return_type: RefCell { value: Did(Class(<self referential class FizzBuzzFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "build", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(Native(Str(StrWrapper(None)))) }, is_associated_fn: false, is_constructor: false })) }, is_associated_fn: true, is_constructor: false })), read_only: false }] }), lhs_allow_optional_unwrap: true, force_rhs_to_be_unwrapped_lhs: false, signature_check: false, enforce_str_comptime_len_if_present: false }
[ Trace ] Virtual Stack POP
[ Trace ] Virtual Stack PUSH: fn(???) -> Should(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(Native(Str(StrWrapper(None)))) }, is_associated_fn: false, is_constructor: false }))
[ Trace ] + self: Self
[ Trace ] Virtual Stack PUSH: fn(???) -> Should(Native(Str(StrWrapper(None))))
[ Trace ] + input: int
[ Trace ] + result: str
[ Trace ] Virtual Stack PUSH: Number Loop -> ParentShould(Native(Str(StrWrapper(None))))
[ Trace ] + i: int
[ Trace ] + conditions: ConditionFactory
[ Trace ] Virtual Stack PUSH: Number Loop -> ParentShould(Native(Str(StrWrapper(None))))
[ Trace ] + j: int
[ Debug ] lhs:Native(Int) rhs:Native(Int) f:TypecheckFlags { executing_class: Some(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] }), lhs_allow_optional_unwrap: false, force_rhs_to_be_unwrapped_lhs: false, signature_check: false, enforce_str_comptime_len_if_present: false }
[ Trace ] + number: int
[ Trace ] + repr: str
[ Trace ] Virtual Stack PUSH: If Block -> ParentShould(Native(Str(StrWrapper(None))))
[ Trace ] Virtual Stack POP
[ Trace ] Virtual Stack POP
[ Trace ] Virtual Stack POP
[ Debug ] lhs:Native(Str(StrWrapper(None))) rhs:Native(Str(StrWrapper(Some(0)))) f:TypecheckFlags { executing_class: Some(ClassType { name: "FizzBuzzFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "conditions", ty: Some(List(Open(Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_condition", ty: Some(Function(FunctionType { parameters: TypesOnly([Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })]), return_type: RefCell { value: Did(Class(<self referential class FizzBuzzFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "build", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(Native(Str(StrWrapper(None)))) }, is_associated_fn: false, is_constructor: false })) }, is_associated_fn: true, is_constructor: false })), read_only: false }] }), lhs_allow_optional_unwrap: true, force_rhs_to_be_unwrapped_lhs: false, signature_check: false, enforce_str_comptime_len_if_present: false }
[ Trace ] Virtual Stack POP
[ Debug ] lhs:Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(Native(Str(StrWrapper(None)))) }, is_associated_fn: false, is_constructor: false }) rhs:Function(FunctionType { parameters: Named([Ident { name: "input", ty: Some(Native(Int)), read_only: false }]), return_type: RefCell { value: Did(Native(Str(StrWrapper(None)))) }, is_associated_fn: false, is_constructor: false }) f:TypecheckFlags { executing_class: Some(ClassType { name: "FizzBuzzFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "conditions", ty: Some(List(Open(Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_condition", ty: Some(Function(FunctionType { parameters: TypesOnly([Class(ClassType { name: "ConditionFactory", path_str: ".\\fizzbuzz.mmm", fields: [Ident { name: "valid_inputs", ty: Some(List(Open(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))))), read_only: false }, Ident { name: "$constructor", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Void }, is_associated_fn: false, is_constructor: true })), read_only: true }, Ident { name: "with_input", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int), Native(Str(StrWrapper(None)))]), return_type: RefCell { value: Did(Class(<self referential class ConditionFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "len", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Native(Int)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "nth", ty: Some(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(List(Mixed([Native(Int), Native(Str(StrWrapper(None)))]))) }, is_associated_fn: true, is_constructor: false })), read_only: false }] })]), return_type: RefCell { value: Did(Class(<self referential class FizzBuzzFactory>)) }, is_associated_fn: true, is_constructor: false })), read_only: false }, Ident { name: "build", ty: Some(Function(FunctionType { parameters: TypesOnly([]), return_type: RefCell { value: Should(Function(FunctionType { parameters: TypesOnly([Native(Int)]), return_type: RefCell { value: Should(Native(Str(StrWrapper(None)))) }, is_associated_fn: false, is_constructor: false })) }, is_associated_fn: true, is_constructor: false })), read_only: false }] }), lhs_allow_optional_unwrap: true, force_rhs_to_be_unwrapped_lhs: false, signature_check: false, enforce_str_comptime_len_if_present: false }
[ Debug ] lhs:Native(Str(StrWrapper(None))) rhs:Native(Str(StrWrapper(None))) f:TypecheckFlags { executing_class: None, lhs_allow_optional_unwrap: false, force_rhs_to_be_unwrapped_lhs: false, signature_check: false, enforce_str_comptime_len_if_present: false }
[ Debug ] lhs:Native(Int) rhs:Native(Int) f:TypecheckFlags { executing_class: None, lhs_allow_optional_unwrap: false, force_rhs_to_be_unwrapped_lhs: false, signature_check: true, enforce_str_comptime_len_if_present: false }
[ Trace ] Virtual Stack POP
[ Trace ] Virtual Stack POP
[ Trace ] in scope Module, adding type FizzBuzzFactory = FizzBuzzFactory
[ Trace ] + FizzBuzzFactory: FizzBuzzFactory
[00:00:00] Validating (./fizzbuzz.ms):   Done in 10.8437ms
[ Trace ] Added compilation step: ".\\fizzbuzz.ms"
[ Debug ] [cc] FINAL COMPILATION LIST: [".\\fizzbuzz.ms"]
[ Info ] checking validation of `".\\fizzbuzz.ms"`: completed
[ Info ] [cc] @ .\fizzbuzz.mmm
[ Trace ] reg. -n--- 0
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 2
[ Trace ] reg. -n--- 3
[ Trace ] reg. -n--- 4
[ Trace ] reg. -n--- 5
[ Trace ] reg. -n--- 5
[ Trace ] reg. F--e- 4
[ Trace ] reg. -G--m 3
[ Trace ] reg. -G--m 3
[ Trace ] reg. F--em 1
[ Trace ] reg. -n--- 0
[ Trace ] reg. -n--- 0
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 2
[ Trace ] reg. F--em 0
[ Trace ] reg. -n--- 0
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 2
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 2
[ Trace ] reg. -n--- 3
[ Trace ] reg. F--e- 2
[ Trace ] reg. F--e- 1
[ Trace ] reg. -n--- 0
[ Trace ] reg. F--e- 0
[ Trace ] reg. -n--- 0
[ Trace ] reg. -n--- 0
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 0
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 2
[ Trace ] reg. -n--- 3
[ Trace ] reg. -G--m 3
[ Trace ] reg. -G--m 3
[ Trace ] reg. F--em 1
[ Trace ] reg. -n--- 0
[ Trace ] reg. -n--- 0
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 2
[ Trace ] reg. -n--- 2
[ Trace ] reg. -n--- 3
[ Trace ] reg. F--em 0
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 2
[ Trace ] reg. -n--- 3
[ Trace ] reg. -n--- 2
[ Trace ] reg. -n--- 3
[ Trace ] reg. -n--- 4
[ Trace ] reg. F--e- 3
[ Trace ] reg. F--e- 2
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 2
[ Trace ] reg. -n--- 2
[ Trace ] reg. -n--- 3
[ Trace ] reg. F--em 0
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 2
[ Trace ] reg. -n--- 2
[ Trace ] reg. -n--- 3
[ Trace ] reg. -n--- 4
[ Trace ] reg. -G--m 4
[ Trace ] reg. -G--m 4
[ Trace ] reg. F--em 1
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 2
[ Trace ] reg. -n--- 3
[ Trace ] reg. -n--- 3
[ Trace ] reg. -n--- 2
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 2
[ Trace ] reg. -n--- 2
[ Trace ] reg. -n--- 1
[ Trace ] reg. -n--- 0
[ Trace ] reg. F--e- 0
[ Trace ] reg. -n--- 0
[ Trace ] reg. -n--- 0
[ Trace ] reg. -n--- 1
[00:00:00] Optimizing (./fizzbuzz.ms):   Done in 69.2µs

Compiled in 19.0939ms

[ Trace ] [BLDR ADD_FN @ ./fizzbuzz.mmm] `ConditionFactory::with_input`
[ Trace ] [BLDR ADD_FN @ ./fizzbuzz.mmm] `ConditionFactory::len`
[ Trace ] [BLDR ADD_FN @ ./fizzbuzz.mmm] `ConditionFactory::nth`
[ Trace ] [BLDR ADD_FN @ ./fizzbuzz.mmm] `ConditionFactory::$constructor`
[ Trace ] [BLDR ADD_FN @ ./fizzbuzz.mmm] `ConditionFactory`
[ Trace ] [BLDR ADD_FN @ ./fizzbuzz.mmm] `FizzBuzzFactory::with_condition`
[ Trace ] [BLDR ADD_FN @ ./fizzbuzz.mmm] `__fn0`
[ Trace ] [BLDR ADD_FN @ ./fizzbuzz.mmm] `FizzBuzzFactory::build`
[ Trace ] [BLDR ADD_FN @ ./fizzbuzz.mmm] `FizzBuzzFactory::$constructor`
[ Trace ] [BLDR ADD_FN @ ./fizzbuzz.mmm] `FizzBuzzFactory`
[ Trace ] [BLDR ADD_FN @ ./fizzbuzz.mmm] `__module__`
Running...

[ Info ] Loading instructions from file...
[ Info ] Loaded instructions from file
[ Info ] Synced module cache with the entrypoint
[ Trace ] Creating call stack...
[ Trace ] Created call stack
[ Debug ] Spawning interpreter...
[ Trace ] Stack ++PUSH ./fizzbuzz.mmm#__module__
[ Trace ] [add_export(./fizzbuzz.mmm)] Exporting "ConditionFactory" = PrimitiveFlagsPair(Function(PrimitiveFunction { location: "./fizzbuzz.mmm#ConditionFactory", callback_state: None }), ["READ_ONLY"])
[ Trace ] [add_export(./fizzbuzz.mmm)] exports =
        `ConditionFactory` = function ptr ./fizzbuzz.mmm#ConditionFactory() (attr: ["READ_ONLY"])

******* MSCRIPT INTERPRETER FATAL RUNTIME ERROR *******
Call stack trace:
        >> ./fizzbuzz.mmm#__module__

Caused by:
    0: "make_function" (instruction #2 of __module__)
    1: failed to run instruction
    2: number is not in scope

Please report this at /~https://github.com/mrodz/mscript/issues/new/choose

Error: Interpreter crashed

Expected Behavior

Unpack the resulting array from having called the nth(int) function.

Any ideas where MScript breaks?

  • Bytecode Interpreter
  • Compiler
  • Optimizer
  • Not Sure (It's okay!)
  • Other: please explain

Brain Dump (Optional)

I ran into this while making an over-the-top FizzBuzz factory as a joke.

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions