Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems while implementing #3963 #3965

Open
michaellilltokiwa opened this issue Oct 17, 2024 · 0 comments
Open

Problems while implementing #3963 #3965

michaellilltokiwa opened this issue Oct 17, 2024 · 0 comments
Labels
Fuzion language related to the language, syntax, etc question A decision or information is required

Comments

@michaellilltokiwa
Copy link
Member

Had to change sorted_entries implementation because of this issue.

./build/lib/container/ordered_map.fz:76:27: error 1: Incompatible types when passing argument in a call
      .find_by_comparator (e -> ks[e.i] ⋄ k)

Actual type for argument #1 'cmp' does not match expected type.
In call to          : 'container.sorted_array.find_by_comparator'
expected formal type: 'Unary i32 (container.ordered_map.this container.ordered_map.OK container.ordered_map.V).entry'
actual type found   : '((container.this.ordered_map.this container.ordered_map.OK container.ordered_map.V).index [ ].this).λ'
assignable to       : '((container.this.ordered_map.this container.ordered_map.OK container.ordered_map.V).index [ ].this).λ',
                      'Any',
                      'Function i32 (container.this.ordered_map.this container.ordered_map.OK container.ordered_map.V).entry',
                      'Unary i32 (container.this.ordered_map.this container.ordered_map.OK container.ordered_map.V).entry'
for value assigned  : '(e -> ks[e.i] ⋄ k)'
To solve this, you could change the type of the target 'cmp' to '((container.this.ordered_map.this container.ordered_map.OK container.ordered_map.V).index [ ].this).λ' or convert the type of the assigned value to 'Unary i32 (container.ordered_map.this container.ordered_map.OK container.ordered_map.V).entry'.


./build/lib/container/ordered_map.fz:82:66: error 2: Incompatible types when passing argument in a call
  public redef items Sequence (tuple OK V) => sorted_entries.map e->(e.key, e.val)

Actual type for argument #1 'f' does not match expected type.
In call to          : 'Sequence.map'
expected formal type: 'Unary (tuple container.ordered_map.OK container.ordered_map.V) (container.ordered_map.this container.ordered_map.OK container.ordered_map.V).entry'
actual type found   : '(container.this.ordered_map.this container.ordered_map.OK container.ordered_map.V).items.this.λ'
assignable to       : '(container.this.ordered_map.this container.ordered_map.OK container.ordered_map.V).items.this.λ',
                      'Any',
                      'Function (tuple container.ordered_map.OK container.ordered_map.V) (container.this.ordered_map.this container.ordered_map.OK container.ordered_map.V).entry',
                      'Unary (tuple container.ordered_map.OK container.ordered_map.V) (container.this.ordered_map.this container.ordered_map.OK container.ordered_map.V).entry'
for value assigned  : 'e->(e.key, e.val)'
To solve this, you could change the type of the target 'f' to '(container.this.ordered_map.this container.ordered_map.OK container.ordered_map.V).items.this.λ' or convert the type of the assigned value to 'Unary (tuple container.ordered_map.OK container.ordered_map.V) (container.ordered_map.this container.ordered_map.OK container.ordered_map.V).entry'.

2 errors.
make: *** [Makefile:619: build/modules/base.fum] Error 1
@michaellilltokiwa michaellilltokiwa added question A decision or information is required Fuzion language related to the language, syntax, etc labels Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fuzion language related to the language, syntax, etc question A decision or information is required
Projects
None yet
Development

No branches or pull requests

1 participant