github onflow/cadence v1.7.0-preview.1

latest release: v1.7.0-preview.2
pre-release18 days ago

What's Changed

๐Ÿ’ฅ Go API Breaking Chance

โญ Features

  • [Compiler] Support inherited functions and conditions through delegation by @SupunS in #3734
  • [Compiler] Compile if-let by @turbolent in #3756
  • [Compiler] Compile switch by @turbolent in #3757
  • [Compiler] Support accessing result variable inside post conditions by @SupunS in #3741
  • [Compiler] Compile and execute emit statement by @turbolent in #3768
  • [Compiler] Support basic casting operations in VM by @SupunS in #3767
  • [Compiler] Support compilation for before statements by @SupunS in #3763
  • [Compiler] Implement scoping by @turbolent in #3789
  • [Compiler] Compile fixed-point literals and add UFix64 to VM by @turbolent in #3791
  • [Compiler] Compile for-loops by @SupunS in #3793
  • [Compiler] Compile conditional expression by @turbolent in #3795
  • [Compiler] Compile boolean operators by @turbolent in #3796
  • [Compiler] Compile bitwise operators, add bitwise instructions by @turbolent in #3797
  • [Compiler] Compile remaining unary operators by @turbolent in #3799
  • [Compiler] Compile remaining unary operators by @turbolent in #3800
  • [Compiler] Compile transaction pre/post conditions by @SupunS in #3801
  • [Compiler] Compile force expression by @turbolent in #3803
  • [Compiler] Add type construction and conversion standard-library functions by @SupunS in #3829
  • [Compiler] Add stdlib functions for Account.Capabilities and Account.StorageCapabilities by @SupunS in #3832
  • [Compiler] Support compilation for conditional returns by @SupunS in #3816
  • [Compiler] Compile simple function expressions by @turbolent in #3834
  • [Compiler] Compile simple inner functions by @turbolent in #3839
  • [Compiler] Compile upvalues by @turbolent in #3842
  • [Compiler] Implement unclosed upvalues in VM by @turbolent in #3843
  • [Compiler] Implement closed upvalues in VM by @turbolent in #3846
  • [Compiler] Add UUID to resources by @turbolent in #3850
  • [Compiler] Support builtin methods for user-defined types by @SupunS in #3872
  • [Compiler] Enable access to last instruction, test codegens by @turbolent in #3874
  • [Compiler] Support use of member-functions as function-pointers by @SupunS in #3886
  • [Compiler] Implement Compiler/VM-based environment, enable for contract invocations by @turbolent in #3894
  • [Compiler] Implement saturating arithmetic functions in VM by @turbolent in #3911
  • [Compiler] Unify emission of event value and event fields, enable event emission in VM environment by @turbolent in #3916
  • [Compiler] Compile global variables by @SupunS in #3920
  • [Compiler] Implement Number types' methods and static functions by @turbolent in #3982
  • [Compiler] Implement built-in methods and functions for Address by @turbolent in #3983
  • [Compiler] Support optional chaining in compiler by @SupunS in #3984
  • [Compiler] Improve native functions by @turbolent in #3986
  • [Compiler] Compile second value assignment by @SupunS in #3987
  • [Compiler] Check resource loss in assignments by @SupunS in #3988
  • [Compiler] Compile enums by @turbolent in #3989
  • [Compiler] Computation metering by @turbolent in #3998
  • [Compiler] Enable execution of scripts with VM by @turbolent in #4000
  • [Compiler] Enable execution of transactions with VM by @turbolent in #4001
  • [Compiler] Test optional arguments by @RZhang05 in #3997
  • [Compiler] Compile swap statements by @turbolent in #4003
  • [Compiler] Emit default destroyed events when resources are destroyed by @SupunS in #4004
  • [Compiler] Implement storage and container mutation prevention by @turbolent in #4007
  • [Compiler] Improve scripts by @turbolent in #4013
  • [Compiler] Implement Capability.check function, fix Capability.borrow by @turbolent in #4017
  • [Compiler] Implement String Templates by @RZhang05 in #4019
  • [Compiler] Close upvalues for locals of for loops by @turbolent in #4020
  • [Compiler] Compile void expressions by @turbolent in #4023
  • [Compiler] Implement more stdlib functions by @turbolent in #4031
  • [Compiler] Implement Account.Keys functions for VM by @turbolent in #4032
  • [Compiler] Implement Account.Inbox and Account.AccountCapabilities functions for VM by @turbolent in #4034
  • [Compiler] Implement RLP and BLS functions for VM by @turbolent in #4035
  • [Compiler] Implement StorageCapabilityController and AccountCapabilityController functions for VM by @turbolent in #4036
  • [Compiler] Implement HashAlgorithm and SignatureAlgorithm for VM by @turbolent in #4037
  • [Compiler] Implement PublicKey constructor for VM by @turbolent in #4038
  • [Compiler] Allow loading of flow.* types in VM environment by @turbolent in #4039
  • [Compiler] Implement some Account.Contracts and DeployedContract functions by @turbolent in #4044
  • Merge compiler feature branch by @turbolent in #4049
  • [Compiler] Add support for injected values and types in VM environment by @turbolent in #4055
  • [Compiler] Implement contract deployment and update in VM environment by @turbolent in #4060
  • [Compiler] Implement contract removal and recoverable contract update for VM environment by @turbolent in #4061
  • [Compiler] Add call stack depth limit to VM by @turbolent in #4067
  • [Compiler] Implement getting contract value in VM by @turbolent in #4069
  • Add a tool to generate a CSV file of all parser and semantic errors by @turbolent in #4064
  • [Compiler] Implement InclusiveRange by @turbolent in #4081
  • Add a new tool to decode a single slab by @turbolent in #4119
  • [Compiler] Improve tracing in interpreter, add support for tracing to VM by @turbolent in #4122
  • Validate documentation links of errors by @turbolent in #4132
  • Add a tool which allows applying changes to a Go expression by @turbolent in #4145

๐Ÿ›  Improvements

  • [Compiler] Optimize function calls by @SupunS in #3704
  • [Custom VM] Improve and test instruction printer by @turbolent in #3706
  • [Compiler+VM PoC] Refactor bytecode encoding by @turbolent in #3713
  • [Compiler+VM PoC] Refactor instruction encoding/decoding by @turbolent in #3714
  • [Compiler+VM PoC] Allow compiler to generate instructions, retarget VM to use instructions by @turbolent in #3715
  • [Compiler+VM POC] Generate the code for the instructions by @turbolent in #3716
  • [Compiler+VM POC] Improve the custom instructions set by @SupunS in #3718
  • [Compiler+VM POC] Document effects of instructions on value stack and control stack by @turbolent in #3719
  • [Compiler] Fix linter warnings by @SupunS in #3735
  • [Compiler] Improve VM stack operations by @turbolent in #3745
  • [Compiler] Fix operand order for SetField and SetIndex instructions, check resource invalidation by @turbolent in #3746
  • [Compiler] Compile dictionary expressions, implement NewDictionary instruction by @turbolent in #3747
  • [Compiler] Improve compiler tests by @turbolent in #3755
  • [Compiler] Improve default functions existence with conditions by @SupunS in #3754
  • [Compiler] Generalize arithmetic instructions for all number values by @turbolent in #3761
  • [Compiler] Reenable compiler tests by @turbolent in #3774
  • [Compiler] Inline inherited conditions instead generating a separate function by @SupunS in #3764
  • [Compiler] Test compilation of currently supported features by @turbolent in #3786
  • [Compiler] Re-enable skipped tests by @SupunS in #3794
  • [Compiler] Produce an un-encoded program by the compiler by @SupunS in #3798
  • [Compiler] Update fungible token tests by @turbolent in #3802
  • [Compiler] Optimize allocations and program components by @turbolent in #3808
  • [Compiler] Run existing interpreter tests with the compiler and VM by @SupunS in #3813
  • [Compiler] Refactor vm.Value and related operations to be independent of the vm.Config by @SupunS in #3817
  • [Compiler] Decouple value.Transfer method from the interpreter by @SupunS in #3819
  • [Compiler] Decouple Value.MeteredString method from the interpreter by @SupunS in #3821
  • [Compiler] Decouple GetMember and SetMember methods of interpreter.Value from the interpreter by @SupunS in #3822
  • [Compiler] Decouple ValueIndexableValue interface from the interpreter by @SupunS in #3824
  • [Compiler] Re-use interpreter.Value in the VM by @SupunS in #3825
  • [Compiler] Decouple interpreter.Invocation from the Interpreter instance by @SupunS in #3826
  • [Compiler] Re-use interpreter's account related stdlibs in vm by @SupunS in #3827
  • [Compiler] Reuse value-conversions of interpreter in vm by @SupunS in #3828
  • [Compiler] Fix FT test in vm by @SupunS in #3830
  • [Compiler] Add remaining Account.Storage stdlib functions to the VM by @SupunS in #3831
  • [Compiler] Work towards implementing closures by @turbolent in #3840
  • [Compiler] Test contract account and resource owner fields by @turbolent in #3841
  • [Compiler] Sync feature/compiler with master by @SupunS in #3848
  • [Compiler] Clean up VM tests by @turbolent in #3853
  • [Compiler] Complete the implementation of vm function values by @SupunS in #3851
  • [Compiler] Support entitlements in compiler/vm by @SupunS in #3858
  • [Compiler] Implement more builtin types and functions by @turbolent in #3859
  • [Compiler] Improve compilation of constants by @turbolent in #3862
  • [Compiler] Improve program printing by @turbolent in #3865
  • [Compiler] Improve program printer by @turbolent in #3868
  • [Compiler] Register common type-bound functions for all builtin types by @SupunS in #3869
  • [Compiler] Rename path instruction by @turbolent in #3870
  • [Compiler] Optimize transfer instructions by @turbolent in #3875
  • [Compiler] Improve program printing by @turbolent in #3871
  • [Compiler] Separate out the re-usable components of the vm.Config by @SupunS in #3881
  • [Compiler] Separate methods from fields for SimpleCompositeValue by @SupunS in #3890
  • [Compiler] Optimize transfers by @turbolent in #3879
  • [Compiler] Invoke contract function externally by @SupunS in #3895
  • [Compiler] Refactor qualified name generation by @SupunS in #3898
  • [Compiler] Sync compiler branch with master by @SupunS in #3904
  • [Compiler] Derive the function type from the receiver for bound-function values by @SupunS in #3897
  • [Compiler] Add dictionary built-in functions by @SupunS in #3907
  • [Compiler] Fix function invocation by @SupunS in #3908
  • [Compiler] Various improvements/fixes by @turbolent in #3909
  • [Compiler] Configure account handler in VM environment by @turbolent in #3912
  • [Compiler] Fix contract value use inside of contract by @turbolent in #3910
  • [Compiler] Add support for resource fields in VM environment by @turbolent in #3913
  • [Compiler] Improve and fix event emission by @turbolent in #3914
  • [Compiler] Skip events compilation by @SupunS in #3915
  • [Compiler] Enable conditions test by @SupunS in #3917
  • [Compiler] Run more tests with the compiler and VM by @SupunS in #3921
  • [Compiler] Refactor test utility functions by @SupunS in #3924
  • [Compiler] Run more tests with the compiler by @SupunS in #3925
  • [Compiler] Run interpreter/misc_test.go with compiler by @SupunS in #3926
  • [Compiler] Pass vm.Context instead of vm.Config to contract function handler by @SupunS in #3933
  • [Compiler] Fix compilation of inherited conditions with different parameters by @SupunS in #3932
  • [Compiler] Refactor function invocation on vm by @SupunS in #3934
  • [Compiler] Add receiver validation for bound functions by @SupunS in #3935
  • [Compiler] Add string stdlib functions by @SupunS in #3936
  • [Compiler] Compile position info as a line-number table by @SupunS in #3939
  • [Compiler] Run most metatype tests and all interface tests with compiler/VM by @turbolent in #3941
  • [Compiler] Register type constructor functions in VM, run runtime-type tests with compiler/VM by @turbolent in #3945
  • [Compiler] Improve invocation of external functions and transactions by @turbolent in #3947
  • [Compiler] Include location range for panicked errors in vm by @SupunS in #3946
  • [Compiler] Enable arithmetic and bitwise tests to run with compiler/VM by @turbolent in #3948
  • [Compiler] Enable more interpreter tests to be run with the compiler / VM by @turbolent in #3949
  • [Compiler] Make the location-range field settable in all interpreter errors by @SupunS in #3950
  • [Compiler] Run more tests with compiler/vm by @SupunS in #3953
  • [Compiler] Run resources-test with the compiler by @SupunS in #3938
  • [Compiler] Improve imports compilation for transitive dependencies by @SupunS in #3957
  • [Compiler] Remove dependency to interpreter.Config from VM by @SupunS in #3964
  • [Compiler] Optimize computation metering by @turbolent in #4002
  • [Compiler] Validate the destruction of already destroyed resources by @SupunS in #4009
  • [Compiler] Meter computation for "entry point" function invocations in interpreter by @turbolent in #4008
  • [Compiler] Improve memory metering by @turbolent in #4010
  • [Compiler] Optimize builtin globals in VM by @turbolent in #4011
  • [Compiler] Optimize builtin globals in Compiler by @turbolent in #4012
  • [Compiler] Run more tests with compiler by @SupunS in #4029
  • [Compiler] Compile conditions in function-expressions and inner-functions by @SupunS in #4027
  • [Compiler] Refactor stdlib functions by @turbolent in #4030
  • [Compiler] Refactor method invocation by @SupunS in #4041
  • [Compiler] Add member access type validation in VM by @SupunS in #4047
  • [Compiler] Re-use static-type to sema-type conversion results by @SupunS in #4054
  • [Compiler] Recover errors in VM like in interpreter by @turbolent in #4065
  • [Compiler] Improve VM config by @turbolent in #4066
  • [Compiler] Optimize VM context creation by @turbolent in #4071
  • [Compiler] Various improvements by @turbolent in #4070
  • [Compiler] Support meta-type isRecovered field in VM by @SupunS in #4073
  • [Compiler] Register common built-in type bound functions for values injected into VM environment by @turbolent in #4072
  • [Compiler] Produce ConditionError for pre/post condition failures in VM by @turbolent in #4077
  • [Compiler] Support iterating storage with broken types in VM by @SupunS in #4079
  • [Compiler] Enable more tests to be run with VM by @turbolent in #4085
  • Clean up test utils by @turbolent in #4084
  • Interpreter: Evaluate and transfer invocation, array, and dictionary arguments immediately by @turbolent in #4089
  • [Compiler] Create an implicit reference for self variable by @SupunS in #4097
  • [Compiler] Implement Context.RecoverErrors in VM by @turbolent in #4101
  • [Compiler] Refactor function invocation by @SupunS in #4103
  • [Compiler] Pass the receiver separately to the builtin functions by @SupunS in #4104
  • Remove unused error by @turbolent in #4112
  • [Compiler] Remove outdated todo's in VM by @SupunS in #4113
  • [Compiler] Create SimpleCompositeValues for transactions by @SupunS in #4116
  • Improve event emission by @turbolent in #4117
  • [Compiler] Fix optional chaining in compiler by @SupunS in #4118
  • [Compiler] Improve naming and meter UUID field and value creation in VM by @turbolent in #4120
  • [Compiler] Print stacktrace for VM errors by @SupunS in #4121
  • [4062-Part 1] Update Cadence Errors with recommended fixes and links to documentation by @briandoyle81 in #4108
  • Improve errors and suggested fixes, add tests by @turbolent in #4129
  • Show migration note and documentation link in pretty error printer by @turbolent in #4130
  • [4062-part-3] Update Cadence Errors by @briandoyle81 in #4126
  • Improve errors by @turbolent in #4137

๐Ÿž Bug Fixes

  • [Compiler] Fix break in switch by @turbolent in #3787
  • [Compiler] Skip anonymous functions in linker by @SupunS in #3866
  • [Compiler] Fix native function dynamic dispatching by @SupunS in #3873
  • [Compiler] Fix condition compiling by @SupunS in #3877
  • [Compiler] Improve compilation of static method invocations by @turbolent in #3876
  • [Compiler] Fix inherited conditions compilation by @SupunS in #3884
  • [Compiler] Fix argument compilation: transfer to parameter type, not argument type by @turbolent in #3918
  • [Compiler] Transfer and convert index indexing/key expression by @turbolent in #4005
  • [Compiler] Fix use of imported enum cases by @turbolent in #4043
  • [Compiler] Fix compilation of dynamic method invocation via optional chaining by @turbolent in #4056
  • [Compiler] Fix nested loops by @turbolent in #4074
  • [Compiler] Use the correct environment for runtime tests by @SupunS in #4075
  • [Compiler] Fix inherited default destroy event compilation by @SupunS in #4082
  • [Compiler] Fix second-value assignment for index-expressions by @SupunS in #4088
  • [Compiler] Fix expression evaluation order of second value assignments by @SupunS in #4090
  • [Compiler] Fix contract deployment / initialization by @turbolent in #4092
  • [Compiler] Fix external invocations of bound functions by @SupunS in #4105
  • [Compiler] Fix optional binding expression evaluation order by @SupunS in #4110
  • [Compiler] Fix compilation of for loops over non-reference array with reference values by @turbolent in #4114
  • Fix Array.map and Array.filter by @turbolent in #4115
  • Port v1.6.4-rc.1: Fix conformance kind mismatch error reporting by @SupunS in #4134

๐Ÿงช Testing

  • [Compiler] Adjust parameters to reduce run-time when race detector is enabled by @turbolent in #3732
  • [Compiler] Add tests for compiling casting expressions to casting instructions by @turbolent in #3771
  • [Compiler] Add compiler tests for default functions and function conditions by @SupunS in #3788
  • [Compiler] Run setup account transaction in FT test by @SupunS in #3867
  • [Compiler] Make FT transfer VM test realistic by @turbolent in #3860
  • [Compiler] Run for-statement tests with compiler by @SupunS in #3923
  • [Compiler] Enable more misc tests by @SupunS in #3928
  • [Compiler] Run some more tests with the compiler/vm by @SupunS in #3999
  • [Compiler] Test implicit boxing by @turbolent in #4006
  • [Compiler] Enable more runtime tests to be run with compiler/VM by @turbolent in #4014
  • [Compiler] Enable more tests to be run with with compiler/VM by @turbolent in #4076
  • [Compiler] Enable TestInterpretInterfaceFieldUse to be run with the VM by @turbolent in #4080
  • [Compiler] Enable more tests for VM or add TODO by @turbolent in #4083
  • [Compiler] Enable computation metering / limiting tests to be run with compiler/VM by @turbolent in #4095
  • [Compiler] Fix TestRuntimeWrappedErrorHandling when running with VM by @turbolent in #4093
  • [Compiler] Enable contract update program caching test for VM by @turbolent in #4098
  • Rework test to actual feature: checking return value type by @turbolent in #4091
  • [Compiler] Update and enable test checking GetOrLoadProgram hits for VM by @turbolent in #4096
  • [Compiler] Test construction of InclusiveRange with VM, resolve TODO by @turbolent in #4099
  • [Compiler] Enable storage reference bound function tests by @SupunS in #4102
  • [Compiler] Enable memory metering tests to be run with compiler/VM by @turbolent in #4100
  • [Compiler] Add corresponding VM tests for missing interpreter test by @SupunS in #4106
  • [Compiler] Run more tests with compiler/VM by @SupunS in #4109

๐Ÿ“– Documentation

  • [Compiler] Document stack effects of instructions in their description by @turbolent in #3759

Other Changes

New Contributors

Full Changelog: v1.6.5...v1.7.0-preview.1

Don't miss a new cadence release

NewReleases is sending notifications on new releases.