void main() { auto f1 = cast(int delegate(int) @system)(int x){ return 0; }; // OK auto f2 = cast(@system int delegate(int))(int x){ return 0; }; // Error } DMD 2.055: test.d(3): basic type expected, not @ test.d(3): found '@' when expecting ')' test.d(3): semicolon expected following auto declaration, not 'int' test.d(3): no identifier for declarator int delegate(int) test.d(3): semicolon expected, not ')' test.d(3): found ')' instead of statement test.d(4): unrecognized declaration
The attribute position is clearly defined: https://dlang.org/spec/type.html#TypeSuffix I don't think we need to complicate parsing by allowing leading attributes. If we did we would have to change function literal parsing too.