golemcloud / golem

Golem is an open source durable computing platform that makes it easy to build and deploy highly reliable distributed systems.
https://learn.golem.cloud/
Apache License 2.0
530 stars 59 forks source link

Type checker #998

Closed afsalthaj closed 1 month ago

afsalthaj commented 1 month ago

Lot more issues discovered. There was progressive unification of types in every scan. Ideally this should only be for optimisation of inference. Removing it shouldn't result in test failures, but it did. Investigating it

thread 'type_inference::type_inference_tests::pattern_match_tests::test_pattern_match_with_record_with_select_index' panicked at golem-rib/src/type_inference/mod.rs:1379:62:
called `Result::unwrap()` on an `Err` value: ["Unknown", "Unable to resolve the type of pattern match expression match some(y) {  some(y) => y[0] } ", "Unknown", "Unable to resolve the type of index selection y[0]", "Unknown", "Unable to resolve the type of identifier y", "Unknown", "Unable to resolve the type of identifier y", "Unknown", "Unable to resolve the type of pattern match expression match some(x) {  some(x) => x.foo } ", "Unknown", "Unable to resolve the type of field selection x.foo", "Unknown", "Unable to resolve the type of identifier x", "Un-inferred type for field foo in record: Unknown", "Unable to resolve the type of identifier x", "Un-inferred type for field foo in record: Unknown"]

failures:
    interpreter::rib_interpreter::interpreter_tests::pattern_match_tests::test_interpreter_for_pattern_match_on_tuple_with_all_types
    interpreter::rib_interpreter::interpreter_tests::pattern_match_tests::test_interpreter_for_pattern_match_on_tuple_with_wild_pattern
    type_inference::type_inference_tests::pattern_match_tests::test_pattern_match_with_record
    type_inference::type_inference_tests::pattern_match_tests::test_pattern_match_with_record_with_select_field
    type_inference::type_inference_tests::pattern_match_tests::test_pattern_match_with_record_with_select_index
    type_inference::type_inference_tests::variable_conflict_tests::test_variable_conflict_case