Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static array expressions not fully supported #895

Open
Geod24 opened this issue Feb 28, 2023 · 1 comment
Open

Static array expressions not fully supported #895

Geod24 opened this issue Feb 28, 2023 · 1 comment

Comments

@Geod24
Copy link
Member

Geod24 commented Feb 28, 2023

private immutable bool hasPreviewIn = ((in int[256] a) { return __traits(isRef, a); })(int[256].init);
% generated/dscanner-d5d6920502bf1bfdb29474007a59fd606df0aadc/dsc --styleCheck foo.d
foo.d(1:37)[error]: `(` expected
foo.d(1:53)[error]: invalid variable declaration or function declaration
foo.d(1:54)[error]: no identifier for declarator
foo.d(1:56)[error]: declaration expected instead of `{`
foo.d(1:83)[warn]: Empty declaration
foo.d(1:85)[error]: Declaration expected
foo.d(1:86)[error]: Declaration expected
foo.d(1:87)[error]: Declaration expected
foo.d(1:101)[error]: no identifier for declarator
foo.d(1:102)[warn]: Empty declaration
2023-02-28T12:17:01.257 [warning] first.d:371:visit Could not locate object.d or object.di

Tried several variations of this but nothing worked.

@Geod24
Copy link
Member Author

Geod24 commented Feb 28, 2023

Actually, here's the main problem:

private enum Foo = int[256].init;
foo.d(5:28)[error]: no identifier for declarator

@Geod24 Geod24 changed the title Error when using FuncExpr on RHS of manifest constant Static array expressions not fully supported Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant