(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestIssue854(t *testing.T) { |
| 12 | envType := types.Map{ |
| 13 | "user": types.Map{ |
| 14 | // If we do not specify `Profile` here, |
| 15 | // this is a correct behavior to throw |
| 16 | // on a missing property. |
| 17 | }, |
| 18 | } |
| 19 | |
| 20 | code := `user.Profile?.Address ?? "Unknown address"` |
| 21 | |
| 22 | _, err := expr.Compile(code, expr.Env(envType)) |
| 23 | require.Error(t, err) |
| 24 | } |