Skip to content

Commit

Permalink
Add more context for warnings. Fixes #410 (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin8105 authored and elliotchance committed Dec 5, 2017
1 parent 88fe73d commit 7eee484
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions transpiler/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,15 @@ func transpileMemberExpr(n *ast.MemberExpr, p *program.Program) (
// 1. Types need to be stripped of their pointer, 'FILE *' -> 'FILE'.
// 2. Types may refer to one or more other types in a chain that have
// to be resolved before the real field type can be determined.
err = errors.New("cannot determine type for LHS '" + lhsType +
"', will use 'void *' for all fields")
err = fmt.Errorf("cannot determine type for LHS '%v'"+
", will use 'void *' for all fields. Is lvalue = %v", lhsType, n.IsLvalue)
p.AddMessage(p.GenerateWarningMessage(err, n))
} else {
if s, ok := structType.Fields[rhs].(string); ok {
rhsType = s
} else {
err = errors.New("cannot determine type for RHS, will use" +
" 'void *' for all fields")
err = fmt.Errorf("cannot determine type for RHS '%v', will use"+
" 'void *' for all fields. Is lvalue = %v", rhs, n.IsLvalue)
p.AddMessage(p.GenerateWarningMessage(err, n))
}
}
Expand Down

0 comments on commit 7eee484

Please sign in to comment.