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

operator EQ/NE check #656

Merged
merged 10 commits into from
Mar 4, 2021
Merged

operator EQ/NE check #656

merged 10 commits into from
Mar 4, 2021

Conversation

visualfc
Copy link
Member

@visualfc visualfc commented Jan 19, 2021

fix #637
fix #654

cl: add operator EQ/NE type matched check
bytecode: fix and support chan/func/slice/ptr/map/interface operator EQ/NE

Go+ cl check and dump error

var v int
println(v == nil)  // invalid operator: nil == v (mismatched types nil and int)
var a int
var b uint8
println(a == b) // invalid operator: a == b (mismatched types int and uint8)
var a int
switch a {
    case 0:
    case uint8(1): //invalid case uint8(1) in switch on a (mismatched types int and uint8)
}

@codecov-io
Copy link

Codecov Report

Merging #656 (681f230) into master (4ac059a) will increase coverage by 0.01%.
The diff coverage is 93.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #656      +/-   ##
==========================================
+ Coverage   90.04%   90.06%   +0.01%     
==========================================
  Files          42       42              
  Lines        9256     9278      +22     
==========================================
+ Hits         8335     8356      +21     
  Misses        651      651              
- Partials      270      271       +1     
Impacted Files Coverage Δ
exec/bytecode/exec_op_autogen.go 100.00% <ø> (ø)
cl/check_type.go 70.58% <82.35%> (+1.96%) ⬆️
cl/expr.go 89.31% <100.00%> (+0.02%) ⬆️
cl/stmt.go 92.66% <100.00%> (+0.05%) ⬆️
cl/value.go 81.14% <100.00%> (+1.22%) ⬆️
exec/bytecode/operator.go 89.18% <100.00%> (-0.56%) ⬇️

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 4ac059a...681f230. Read the comment docs.

@xushiwei xushiwei merged commit 6447ddf into goplus:master Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

exec/bytecode: ptr type operator == wrong builtinOp: type interface doesn't support operator ==
3 participants