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

typesutil: update TypeAndValue #1545

Merged
merged 2 commits into from
Nov 16, 2023
Merged

typesutil: update TypeAndValue #1545

merged 2 commits into from
Nov 16, 2023

Conversation

visualfc
Copy link
Member

@visualfc visualfc commented Nov 14, 2023

cl/internal/typesutil: update TypeAndValue

fix #1537

package main

type Person struct {
	name string
	age  int8
}

func test() {
	p := Person{
		name: "jack",
	}
	_ = p.name
}
   info_test.go:106: ====== check types pass (count: 8) ======
        000:  3:13 | struct {
        	name string
        	age  int8
        } *ast.StructType                | type    : struct{name string; age int8} | type
        001:  4: 7 | string              *ast.Ident                     | type    : string | type
        002:  5: 7 | int8                *ast.Ident                     | type    : int8 | type
        003:  9: 7 | Person              *ast.Ident                     | type    : main.Person | type
        004:  9: 7 | Person{
        	name: "jack",
        } *ast.CompositeLit              | value   : main.Person | value
        005: 10: 9 | "jack"              *ast.BasicLit                  | value   : string = "jack" | constant
        006: 12: 6 | p                   *ast.Ident                     | var     : main.Person | variable
        007: 12: 6 | p.name              *ast.SelectorExpr              | var     : string | variable
        
    info_test.go:106: ====== check defs pass (count: 5) ======
        000:  3: 6 | Person              | type main.Person struct{name string; age int8}
        001:  4: 2 | name                | field name string
        002:  5: 2 | age                 | field age int8
        003:  8: 6 | test                | func main.test()
        004:  9: 2 | p                   | var p main.Person
        
    info_test.go:106: ====== check uses pass (count: 6) ======
        000:  4: 7 | string              | type string
        001:  5: 7 | int8                | type int8
        002:  9: 7 | Person              | type main.Person struct{name string; age int8}
        003: 10: 3 | name                | field name string
        004: 12: 6 | p                   | var p main.Person
        005: 12: 8 | name                | field name string

Copy link

codecov bot commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ef48ef5) 91.26% compared to head (e9043a5) 91.32%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1545      +/-   ##
==========================================
+ Coverage   91.26%   91.32%   +0.06%     
==========================================
  Files          40       40              
  Lines       10167    10242      +75     
==========================================
+ Hits         9279     9354      +75     
  Misses        720      720              
  Partials      168      168              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xushiwei xushiwei merged commit c8c8200 into goplus:main Nov 16, 2023
14 checks passed
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.

go+ typesutil.Info support struct type
2 participants