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 {
172
172
for name , typ := range p .fromStruct (f .Type ) {
173
173
types [name ] = typ
174
174
}
175
- } else {
176
- types [f .Name ] = f .Type
177
175
}
176
+
177
+ types [f .Name ] = f .Type
178
178
}
179
179
}
180
180
Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ func TestParser_createTypesTable(t *testing.T) {
233
233
p := parser {}
234
234
types := p .createTypesTable (A {})
235
235
236
- if len (types ) != 2 {
236
+ if len (types ) != 5 {
237
237
t .Error ("unexpected number of fields" )
238
238
}
239
239
if types ["F" ] != intType {
Original file line number Diff line number Diff line change @@ -74,8 +74,11 @@ var typeTests = []typeTest{
74
74
"Int % Int > 1" ,
75
75
"Int in Int..Int" ,
76
76
"EmbStr == ''" ,
77
+ "Embedded.EmbStr" ,
77
78
"EmbPtrStr == ''" ,
79
+ "EmbeddedPtr ~ Str" ,
78
80
"SubStr ~ ''" ,
81
+ "SubEmbedded.SubStr" ,
79
82
"OkFn() and OkFn()" ,
80
83
"Foo.Fn() or Foo.Fn()" ,
81
84
}
@@ -281,10 +284,6 @@ var typeErrorTests = []typeErrorTest{
281
284
"1 in Foo" ,
282
285
"invalid operation: 1 in Foo (mismatched types float64 and *expr_test.foo)" ,
283
286
},
284
- {
285
- "Embedded.EmbStr ~ Str" ,
286
- "unknown name Embedded" ,
287
- },
288
287
}
289
288
290
289
type abc interface {
You can’t perform that action at this time.
0 commit comments