From fe6d1e38fb4fc04323170389cfec67ed7fd4e24a Mon Sep 17 00:00:00 2001 From: WebFreak001 Date: Wed, 5 Jul 2023 20:18:33 +0200 Subject: [PATCH] fix mixin-type variable declarations, fix #496 --- src/dparse/parser.d | 3 +-- test/pass_files/mixin_types.d | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 test/pass_files/mixin_types.d diff --git a/src/dparse/parser.d b/src/dparse/parser.d index 5606d56e..88bef358 100644 --- a/src/dparse/parser.d +++ b/src/dparse/parser.d @@ -2410,8 +2410,7 @@ class Parser else { goToBookmark(b); - error("Declaration expected"); - return null; + goto type; } } else diff --git a/test/pass_files/mixin_types.d b/test/pass_files/mixin_types.d new file mode 100644 index 00000000..2dbae9fd --- /dev/null +++ b/test/pass_files/mixin_types.d @@ -0,0 +1,7 @@ +mixin("int") variableName; +void foo(mixin("int") arg) { + mixin("int") localVar; +} +struct S { + mixin("int") foo; +}