-
Notifications
You must be signed in to change notification settings - Fork 138
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
Bring back type IDs in JSON encoding of function types and restricted types #2551
Conversation
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:master commit 37e11a4 Collapsed results for better readability
|
Verified the fixes by switching the Emulator to use this PR, and then running scripts that return function types and restricted types: $ flow scripts execute <(echo 'pub fun main(): Type { return Type<((): Void)>() }')
Result: Type<(():Void)>() $ flow scripts execute <(echo 'pub struct S {}; pub fun main(): Type { return Type<S{}>() }')
Result: Type<s.468a847f9bdbfee1049c59934b561d32cba5f3045bf3bf7549653cf77e04e6d5.S{}>() These scripts currently fail with:
|
Description
The JSON-CDC encoding of restricted types and function types used to have type IDs.
The type IDs got replaced with structured equivalents. For example, function types used to only have a type ID, but now include parameter types, return type, etc.
#2401 removed the redundant type IDs.
However, before the removal, the JSON decoder required these type IDs. The older decoder is still used by developers in older Go SDK and Flow CLI releases.
Bring back the type IDs for backward compatibility.
master
branchFiles changed
in the Github PR explorer