File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -172,9 +172,9 @@ func (p *parser) fromStruct(t reflect.Type) typesTable {
172172 for name , typ := range p .fromStruct (f .Type ) {
173173 types [name ] = typ
174174 }
175- } else {
176- types [f .Name ] = f .Type
177175 }
176+
177+ types [f .Name ] = f .Type
178178 }
179179 }
180180
Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ func TestParser_createTypesTable(t *testing.T) {
233233 p := parser {}
234234 types := p .createTypesTable (A {})
235235
236- if len (types ) != 2 {
236+ if len (types ) != 5 {
237237 t .Error ("unexpected number of fields" )
238238 }
239239 if types ["F" ] != intType {
Original file line number Diff line number Diff line change @@ -74,8 +74,11 @@ var typeTests = []typeTest{
7474 "Int % Int > 1" ,
7575 "Int in Int..Int" ,
7676 "EmbStr == ''" ,
77+ "Embedded.EmbStr" ,
7778 "EmbPtrStr == ''" ,
79+ "EmbeddedPtr ~ Str" ,
7880 "SubStr ~ ''" ,
81+ "SubEmbedded.SubStr" ,
7982 "OkFn() and OkFn()" ,
8083 "Foo.Fn() or Foo.Fn()" ,
8184}
@@ -281,10 +284,6 @@ var typeErrorTests = []typeErrorTest{
281284 "1 in Foo" ,
282285 "invalid operation: 1 in Foo (mismatched types float64 and *expr_test.foo)" ,
283286 },
284- {
285- "Embedded.EmbStr ~ Str" ,
286- "unknown name Embedded" ,
287- },
288287}
289288
290289type abc interface {
You can’t perform that action at this time.
0 commit comments