Robert Griesemer
489f508ccf
cmd/compile: avoid "not used" errors due to bad go/defer statements
...
The syntax for go and defer specifies an arbitrary expression, not
a call; the call requirement is spelled out in prose. Don't to the
call check in the parser; instead move it to the type checker. This
is simpler and also allows the type checker to check expressions that
are not calls, and avoid "not used" errors due to such expressions.
We would like to make the same change in go/parser and go/types
but the change requires Go/DeferStmt nodes to hold an ast.Expr
rather than an *ast.CallExpr. We cannot change that for backward-
compatibility reasons. Since we don't test this behavior for the
type checkers alone (only for the compiler), we get away with it
for now.
Follow-up on CL 425675 which introduced the extra errors in the
first place.
Change-Id: I90890b3079d249bdeeb76d5673246ba44bec1a7b
Reviewed-on: https://go-review.googlesource.com/c/go/+/425794
Reviewed-by: Robert Griesemer <gri@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Robert Griesemer <gri@google.com >
Auto-Submit: Robert Griesemer <gri@google.com >
Reviewed-by: Alan Donovan <adonovan@google.com >
2022-09-01 23:17:52 +00:00
..
2022-03-24 02:14:15 +00:00
2021-05-19 06:26:35 +00:00
2021-05-19 06:26:35 +00:00
2021-05-19 06:26:35 +00:00
2022-01-11 02:26:58 +00:00
2022-03-24 02:14:15 +00:00
2022-03-24 17:50:47 +00:00
2022-03-24 02:14:15 +00:00
2022-03-24 02:14:15 +00:00
2022-03-24 02:14:15 +00:00
2022-01-11 15:28:40 +00:00
2022-03-24 17:50:47 +00:00
2022-05-16 19:48:35 +00:00
2022-03-24 02:14:15 +00:00
2022-03-24 02:14:15 +00:00
2022-07-19 19:36:23 +00:00
2022-03-24 17:50:47 +00:00
2021-07-26 18:43:12 +00:00
2022-03-24 02:14:15 +00:00
2022-03-24 02:14:15 +00:00
2022-03-24 02:14:15 +00:00
2022-03-24 02:14:15 +00:00
2021-10-26 14:24:17 +00:00
2022-03-24 02:14:15 +00:00
2022-03-24 02:14:15 +00:00
2022-03-24 02:14:15 +00:00
2022-03-24 02:14:15 +00:00
2022-03-24 02:14:15 +00:00
2022-03-24 02:14:15 +00:00
2022-03-24 02:14:15 +00:00
2022-03-24 02:14:15 +00:00
2022-03-24 02:14:15 +00:00
2022-06-06 19:21:04 +00:00
2022-03-24 17:50:47 +00:00
2022-03-24 02:14:15 +00:00
2021-06-09 02:18:34 +00:00
2022-03-24 02:14:15 +00:00
2022-03-24 02:14:15 +00:00
2021-08-13 20:47:06 +00:00
2021-07-19 13:27:46 +00:00
2021-12-03 16:24:32 +00:00
2021-07-22 20:47:59 +00:00
2022-03-24 02:14:15 +00:00
2021-10-20 17:26:58 +00:00
2021-10-22 00:57:18 +00:00
2021-10-27 05:33:58 +00:00
2022-06-24 17:48:24 +00:00
2022-05-18 00:45:20 +00:00
2022-06-06 19:20:41 +00:00
2022-05-10 19:15:31 +00:00
2022-04-28 18:02:40 +00:00
2022-06-26 00:26:59 +00:00
2022-06-27 16:12:51 +00:00
2021-09-23 19:41:45 +00:00
2022-03-30 18:02:38 +00:00
2021-09-23 19:41:45 +00:00
2022-05-18 00:47:29 +00:00
2021-09-23 19:41:45 +00:00
2022-01-11 02:26:58 +00:00
2022-01-18 23:59:40 +00:00
2022-01-11 02:26:58 +00:00
2021-03-23 05:11:09 +00:00
2022-01-11 02:26:58 +00:00
2022-01-11 02:26:58 +00:00
2022-01-11 02:26:58 +00:00
2022-02-11 22:01:05 +00:00
2021-07-28 21:41:07 +00:00
2021-09-23 19:41:45 +00:00
2021-11-24 20:57:46 +00:00
2022-03-24 17:50:47 +00:00
2022-03-25 21:58:03 +00:00
2022-01-11 02:26:58 +00:00
2022-01-11 02:26:58 +00:00
2021-11-12 23:07:01 +00:00
2021-03-23 05:11:09 +00:00
2022-01-11 02:26:58 +00:00
2021-03-17 19:15:18 +00:00
2021-03-24 21:20:10 +00:00
2022-09-01 15:27:07 +00:00
2022-02-13 18:51:07 +00:00
2021-08-25 03:13:06 +00:00
2022-01-18 21:43:02 +00:00
2022-01-11 02:26:58 +00:00
2022-01-11 02:26:58 +00:00
2021-05-19 06:26:35 +00:00
2021-12-03 16:24:32 +00:00
2021-11-22 23:51:43 +00:00
2021-11-22 23:51:43 +00:00
2021-11-12 23:07:01 +00:00
2021-03-23 05:11:09 +00:00
2021-11-22 23:51:43 +00:00
2022-01-11 02:26:58 +00:00
2022-01-11 02:26:58 +00:00
2022-01-11 02:26:58 +00:00
2022-01-11 02:26:58 +00:00
2022-01-11 02:26:58 +00:00
2022-06-09 01:34:45 +00:00
2021-07-28 21:41:07 +00:00
2021-11-18 02:53:02 +00:00
2021-07-28 21:41:07 +00:00
2021-09-23 19:41:45 +00:00
2022-05-16 18:19:47 +00:00
2021-11-12 23:07:01 +00:00
2021-08-13 21:43:20 +00:00
2021-05-20 16:41:09 +00:00
2021-08-25 23:43:53 +00:00
2021-03-23 05:11:09 +00:00
2021-03-23 05:11:09 +00:00
2022-01-11 02:26:58 +00:00
2022-01-11 02:26:58 +00:00
2022-01-11 02:26:58 +00:00
2022-01-11 02:26:58 +00:00
2022-01-11 15:28:40 +00:00
2022-02-04 23:42:25 +00:00
2022-03-09 21:31:58 +00:00
2021-05-26 23:50:32 +00:00
2021-05-26 23:50:32 +00:00
2022-09-01 22:37:04 +00:00
2022-03-31 00:26:58 +00:00
2022-03-29 17:21:15 +00:00
2021-03-23 05:11:09 +00:00
2022-01-11 02:26:58 +00:00
2022-01-11 02:26:58 +00:00
2022-03-01 19:45:34 +00:00
2021-06-04 17:00:19 +00:00
2021-11-26 13:06:40 +00:00
2021-12-03 16:24:32 +00:00
2022-01-11 02:26:58 +00:00
2021-12-03 16:24:32 +00:00
2022-09-01 22:37:04 +00:00
2022-09-01 22:37:04 +00:00
2022-01-11 02:26:58 +00:00
2021-09-23 19:41:41 +00:00
2022-09-01 22:37:04 +00:00
2021-04-21 20:24:34 +00:00
2022-05-16 18:19:47 +00:00
2022-08-11 20:03:02 +00:00
2022-09-01 22:37:03 +00:00
2022-03-09 21:31:58 +00:00
2022-01-11 02:26:58 +00:00
2021-07-28 21:41:07 +00:00
2022-03-09 21:31:58 +00:00
2022-03-09 21:31:58 +00:00
2022-01-07 18:40:16 +00:00
2022-09-01 23:17:52 +00:00
2022-04-26 02:19:42 +00:00
2022-09-01 22:37:04 +00:00
2022-01-11 02:26:58 +00:00
2022-06-15 00:06:24 +00:00
2022-08-19 03:32:04 +00:00
2022-08-19 03:32:27 +00:00
2021-05-27 23:40:56 +00:00
2021-05-27 23:40:56 +00:00
2022-01-11 02:26:58 +00:00
2021-08-03 16:14:24 +00:00
2022-03-09 21:31:58 +00:00
2021-09-23 19:41:41 +00:00
2021-07-28 21:41:07 +00:00
2021-09-23 19:41:41 +00:00
2022-07-06 00:02:11 +00:00
2022-01-11 02:26:58 +00:00
2022-01-19 20:54:49 +00:00
2022-01-11 02:26:58 +00:00
2021-08-03 16:14:24 +00:00
2022-08-08 16:58:57 +00:00
2022-08-09 11:28:56 +00:00
2021-07-26 18:43:12 +00:00
2021-05-26 23:50:45 +00:00
2022-03-09 21:31:58 +00:00
2021-06-23 16:48:12 +00:00
2022-07-19 23:02:39 +00:00
2022-09-01 22:37:04 +00:00
2022-01-11 02:26:58 +00:00
2021-03-25 02:50:11 +00:00
2022-09-01 15:27:07 +00:00
2021-11-12 23:07:01 +00:00
2021-06-17 02:30:22 +00:00
2022-09-01 15:27:07 +00:00
2022-09-01 15:27:07 +00:00
2021-03-18 21:27:21 +00:00
2021-06-17 02:30:22 +00:00
2022-08-16 01:54:23 +00:00
2021-03-11 17:20:58 +00:00
2022-03-01 19:45:34 +00:00
2021-03-10 19:33:23 +00:00
2021-04-27 01:16:39 +00:00
2021-03-28 03:27:04 +00:00
2021-03-24 17:54:03 +00:00
2021-03-26 19:40:37 +00:00
2021-07-28 21:41:07 +00:00
2021-04-02 05:24:14 +00:00
2021-04-02 00:45:56 +00:00
2021-04-07 02:05:55 +00:00
2021-04-14 04:02:01 +00:00
2021-04-23 05:10:41 +00:00
2021-04-21 09:07:09 +00:00
2021-04-22 16:38:37 +00:00
2021-04-23 20:57:54 +00:00
2021-04-26 21:27:41 +00:00
2021-04-28 00:49:58 +00:00
2021-05-03 17:46:12 +00:00
2021-05-03 15:03:57 +00:00
2021-05-05 18:03:32 +00:00
2021-05-05 01:47:58 +00:00
2022-02-07 12:32:51 +00:00
2021-05-22 00:51:17 +00:00
2021-06-08 12:17:50 +00:00
2021-06-04 01:31:23 +00:00
2021-06-03 20:52:22 +00:00
2021-06-09 02:18:34 +00:00
2021-06-13 05:50:15 +00:00
2022-08-11 20:13:07 +00:00
2021-06-17 02:30:22 +00:00
2022-09-01 15:27:07 +00:00
2021-06-24 18:58:27 +00:00
2021-08-25 01:57:42 +00:00
2021-11-24 20:57:46 +00:00
2021-08-23 19:49:23 +00:00
2021-07-07 22:29:01 +00:00
2021-08-13 20:47:06 +00:00
2021-07-19 13:27:46 +00:00
2021-07-15 17:35:20 +00:00
2021-07-21 00:01:12 +00:00
2021-07-22 20:47:59 +00:00
2021-08-16 18:20:12 +00:00
2021-08-25 03:12:43 +00:00
2021-08-24 18:02:21 +00:00
2021-08-28 17:05:43 +00:00
2021-09-02 12:49:05 +00:00
2021-09-01 02:16:30 +00:00
2021-08-31 21:49:48 +00:00
2021-09-01 19:51:25 +00:00
2021-10-15 01:35:56 +00:00
2021-09-09 19:17:02 +00:00
2022-03-01 19:45:34 +00:00
2021-09-13 18:38:15 +00:00
2021-09-19 02:43:09 +00:00
2022-03-01 19:45:34 +00:00
2021-09-20 16:27:53 +00:00
2021-09-20 16:26:30 +00:00
2021-09-23 00:14:22 +00:00
2021-09-23 19:41:41 +00:00
2021-10-07 18:58:33 +00:00
2022-01-18 21:43:02 +00:00
2021-11-24 20:57:46 +00:00
2021-10-29 23:15:00 +00:00
2021-10-29 23:15:00 +00:00
2021-10-12 18:00:16 +00:00
2021-10-15 19:54:44 +00:00
2021-10-17 04:27:13 +00:00
2021-10-19 17:01:35 +00:00
2021-10-20 17:26:58 +00:00
2021-10-23 06:36:16 +00:00
2021-10-22 00:57:18 +00:00
2021-10-21 19:08:43 +00:00
2021-10-21 19:08:43 +00:00
2021-10-28 14:25:03 +00:00
2021-10-28 14:25:03 +00:00
2021-10-27 21:35:48 +00:00
2021-10-23 20:23:35 +00:00
2022-03-01 19:45:34 +00:00
2021-10-25 16:07:11 +00:00
2021-10-25 16:07:11 +00:00
2021-11-02 16:19:45 +00:00
2021-11-04 02:12:52 +00:00
2021-11-06 13:10:06 +00:00
2022-03-01 19:45:34 +00:00
2021-11-05 16:35:00 +00:00
2021-11-11 04:02:33 +00:00
2021-11-15 19:24:28 +00:00
2021-11-16 15:38:59 +00:00
2022-03-01 19:45:34 +00:00
2022-03-01 19:45:34 +00:00
2021-11-19 22:35:28 +00:00
2021-12-02 20:49:56 +00:00
2022-03-01 19:45:34 +00:00
2021-12-15 20:26:03 +00:00
2022-01-13 21:37:29 +00:00
2022-03-01 19:45:34 +00:00
2022-01-06 19:21:12 +00:00
2022-01-19 15:45:58 +00:00
2022-05-11 08:12:15 +00:00
2022-06-24 17:48:24 +00:00
2022-01-27 19:52:52 +00:00
2022-02-14 23:08:44 +00:00
2022-05-18 00:45:20 +00:00
2022-03-01 21:27:42 +00:00
2022-03-03 16:02:44 +00:00
2022-06-28 16:57:18 +00:00
2022-03-08 16:50:57 +00:00
2022-09-01 15:27:07 +00:00
2022-03-21 17:27:41 +00:00
2022-03-30 15:06:59 +00:00
2022-04-12 01:18:27 +00:00
2022-06-06 19:20:41 +00:00
2022-07-25 20:44:49 +00:00
2022-05-10 19:15:31 +00:00
2022-04-19 23:20:21 +00:00
2022-05-06 17:37:12 +00:00
2022-04-28 18:02:40 +00:00
2022-04-29 20:42:52 +00:00
2022-05-05 01:33:11 +00:00
2022-05-05 04:53:27 +00:00
2022-05-08 17:29:15 +00:00
2022-05-09 16:02:28 +00:00
2022-05-09 17:29:53 +00:00
2022-05-09 17:29:53 +00:00
2022-05-12 21:45:28 +00:00
2022-06-22 23:27:17 +00:00
2022-06-26 00:26:59 +00:00
2022-06-27 16:12:51 +00:00
2022-06-16 01:03:59 +00:00
2022-06-27 16:13:35 +00:00
2022-05-17 00:58:22 +00:00
2022-05-18 18:24:59 +00:00
2022-05-23 23:54:07 +00:00
2022-05-31 14:58:09 +00:00
2022-06-13 16:53:11 +00:00
2022-06-21 17:23:40 +00:00
2022-07-06 17:00:37 +00:00
2022-07-06 17:00:37 +00:00
2022-06-30 00:08:36 +00:00
2022-07-08 12:57:49 +00:00
2022-07-06 17:00:37 +00:00
2022-07-06 17:00:37 +00:00
2022-08-14 00:14:04 +00:00
2022-08-11 19:05:54 +00:00
2022-08-08 14:12:01 +00:00
2022-08-16 01:11:29 +00:00
2022-08-08 16:07:39 +00:00
2022-08-11 20:13:07 +00:00
2022-08-15 17:49:19 +00:00
2022-08-23 19:56:32 +00:00
2022-08-24 14:31:08 +00:00
2022-08-26 15:24:31 +00:00
2022-08-30 17:23:27 +00:00
2022-08-30 17:23:27 +00:00