You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix elaboration of function definitions with nested function types
Since commit ea3a41b, `elab_type_declarator` has a special case for function definitions, causing it to include the function parameters in the returned updated typing environment. However, this special case was wrong for nested function types such as
```
int (*f(int y))(int x) { ... }
```
`f` is a function taking an `y` parameter and returning a function `(x: int) -> int`. The special case causes both `x` and `y` to be included in the returned environment, while only `y` should be.
This commit makes sure that the special case for function definitions applies only to the outermost function type, i.e. the innermost `Cabs.PROTO` declarator.
A similar issue was handled correctly in the `Cabs.PROTO_OLD` case, so this commit tries to use the same code structure in the `PROTO` and `PROTO_OLD` cases.
0 commit comments