Created
August 25, 2022 20:52
-
-
Save rlkelly/6cc8f4cce06762c3153fc7e3acaf9429 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%lang starknet | |
from starkware.cairo.common.alloc import alloc | |
struct Foo: | |
member val: felt | |
end | |
func make_foo(value: felt) -> (foo: Foo): | |
let foo = Foo( | |
val=value, | |
) | |
return (foo) | |
end | |
func make_foo_array() -> (entry: Foo*): | |
let (struct_array : Foo*) = alloc() | |
let foo0 = make_foo(0) | |
assert struct_array[0] = foo0 | |
return (struct_array) | |
end | |
@external | |
func test_make_foo{syscall_ptr : felt*, range_check_ptr}(): | |
let (foo_array) = make_foo_array() | |
return () | |
end | |
# File "starkware/cairo/lang/compiler/preprocessor/preprocessor.py", line 1223, in visit_CodeElementCompoundAssertEq | |
# starkware.cairo.lang.compiler.preprocessor.preprocessor_error.PreprocessorError: contracts/tests/test_foo.cairo:22:5: Cannot compare '__main__.Foo' and '(foo : __main__.Foo)'. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment