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

Fix AST walking default-case in switch-statement #1433

Merged
merged 1 commit into from
Feb 18, 2022
Merged

Conversation

SupunS
Copy link
Member

@SupunS SupunS commented Feb 17, 2022

Description

Default-case's doesn't have an expression, skip it from visiting.


  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@codecov-commenter
Copy link

Codecov Report

Merging #1433 (bcdbf86) into master (de9ccd9) will increase coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1433   +/-   ##
=======================================
  Coverage   73.12%   73.12%           
=======================================
  Files         283      283           
  Lines       39081    39082    +1     
=======================================
+ Hits        28577    28578    +1     
  Misses       9056     9056           
  Partials     1448     1448           
Flag Coverage Δ
unittests 73.12% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
runtime/ast/statement.go 92.64% <0.00%> (-0.35%) ⬇️
runtime/sema/simple_type.go 96.42% <0.00%> (+3.57%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de9ccd9...bcdbf86. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Feb 17, 2022

Cadence Benchstat comparison

This branch with compared with the base branch onflow:master commit de9ccd9
The command for i in {1..N}; do go test ./... -run=XXX -bench=. -shuffle=on; done was used.
Bench tests were run a total of 7 times on each branch.

Results

old.txtnew.txt
time/opdelta
RuntimeFungibleTokenTransfer-21.50ms ±25%1.70ms ± 4%~(p=0.073 n=7+6)
RuntimeResourceDictionaryValues-216.8ms ± 3%16.6ms ± 3%~(p=0.456 n=7+7)
ParseFungibleToken-2222µs ± 2%224µs ± 7%~(p=0.535 n=7+7)
ParseArray-217.9ms ± 2%17.9ms ± 6%~(p=0.628 n=6+7)
ParseInfix-210.3µs ± 6%10.0µs ± 2%~(p=0.366 n=7+6)
ParseDeploy/byte_array-229.1ms ± 6%29.5ms ± 2%~(p=0.731 n=7+6)
ParseDeploy/decode_hex-21.44ms ± 3%1.41ms ± 3%~(p=0.101 n=7+6)
QualifiedIdentifierCreation/One_level-22.84ns ± 2%2.84ns ± 2%~(p=0.805 n=7+7)
QualifiedIdentifierCreation/Three_levels-2169ns ± 2%168ns ± 1%~(p=0.250 n=7+7)
ContractInterfaceFungibleToken-247.9µs ± 2%47.9µs ± 2%~(p=1.000 n=7+7)
CheckContractInterfaceFungibleTokenConformance-2158µs ± 2%157µs ± 2%~(p=0.731 n=7+6)
InterpretRecursionFib-22.84ms ± 4%2.78ms ± 4%~(p=0.165 n=7+7)
NewInterpreter/new_interpreter-21.30µs ± 2%1.33µs ± 8%~(p=0.805 n=7+7)
NewInterpreter/new_sub-interpreter-22.57µs ± 2%2.63µs ± 5%~(p=0.165 n=7+7)
 
alloc/opdelta
RuntimeFungibleTokenTransfer-2282kB ± 0%282kB ± 0%~(p=0.456 n=7+7)
RuntimeResourceDictionaryValues-24.05MB ± 0%4.05MB ± 0%~(p=0.383 n=7+7)
QualifiedIdentifierCreation/One_level-20.00B 0.00B ~(all equal)
QualifiedIdentifierCreation/Three_levels-264.0B ± 0%64.0B ± 0%~(all equal)
ContractInterfaceFungibleToken-226.6kB ± 0%26.6kB ± 0%~(p=0.245 n=7+6)
CheckContractInterfaceFungibleTokenConformance-266.2kB ± 0%66.2kB ± 0%~(p=0.538 n=7+6)
InterpretRecursionFib-21.24MB ± 0%1.24MB ± 0%~(p=0.462 n=7+7)
NewInterpreter/new_interpreter-2768B ± 0%768B ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-21.24kB ± 0%1.24kB ± 0%~(all equal)
 
allocs/opdelta
RuntimeFungibleTokenTransfer-24.54k ± 0%4.54k ± 0%~(p=0.714 n=7+7)
RuntimeResourceDictionaryValues-2102k ± 0%102k ± 0%~(p=0.755 n=7+7)
QualifiedIdentifierCreation/One_level-20.00 0.00 ~(all equal)
QualifiedIdentifierCreation/Three_levels-22.00 ± 0%2.00 ± 0%~(all equal)
ContractInterfaceFungibleToken-2458 ± 0%458 ± 0%~(all equal)
CheckContractInterfaceFungibleTokenConformance-21.07k ± 0%1.07k ± 0%~(all equal)
InterpretRecursionFib-225.0k ± 0%25.0k ± 0%~(all equal)
NewInterpreter/new_interpreter-212.0 ± 0%12.0 ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-238.0 ± 0%38.0 ± 0%~(all equal)
 

@SupunS SupunS force-pushed the supun/fix-ast-walker branch from bcdbf86 to 6ac1551 Compare February 17, 2022 23:21
@SupunS SupunS marked this pull request as ready for review February 18, 2022 16:10
@SupunS SupunS merged commit 0126f95 into master Feb 18, 2022
@SupunS SupunS deleted the supun/fix-ast-walker branch February 18, 2022 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants