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

Replace libdparse with DMD in VcallCtorChecker #145

Merged
merged 2 commits into from
Oct 5, 2024

Conversation

Vladiwostok
Copy link
Collaborator

#78 cont
This time without full semantic
I've also did my best to stick to the old libdparse implementation this time

@RazvanN7
Copy link
Collaborator

RazvanN7 commented Oct 2, 2024

Error: cannot find input file `../../../.dub/packages/dmd/~master/dmd/compiler/src/dmd/permissivevisitor.d`

Weird, it seems that dub does not know, or cannot find permissivevisitor.d . What the heck?

@RazvanN7
Copy link
Collaborator

RazvanN7 commented Oct 2, 2024

Got it, it seems that the file has been moved to a different file: dlang/dmd#16875

@RazvanN7
Copy link
Collaborator

RazvanN7 commented Oct 2, 2024

This will prolly fix it: dlang/dmd#16906

private enum string KEY = "dscanner.vcall_ctor";
private enum string MSG = "a virtual call inside a constructor may lead to unexpected results in the derived classes";

private static struct FuncContext
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like you doubled the tab size. Why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't doubled the tab size. I used dfmt to automatically format the file. It was done using tab characters with 4 spaces. Before only spaces were used. I think github shows a wider spacing to differentiate between normal spaces and tabs.

image

Copy link
Collaborator

@RazvanN7 RazvanN7 Oct 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then maybe try dfmt with 4 spaces instead of tabs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using a single TAB character (1 char in bottom right corner of the screenshot) that has the standard size of 4 spaces

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does D's standard style use spaces instead of tabs?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In dmd yes, we have spaces. I think what we are seing here is how a tab is interpreted (default to 4 spaces on your machine, default to 8 on github). Just use spaces and let's not waste more time on this nonsense.

import dscanner.analysis.helpers : assertAnalyzerWarnings;
import std.stdio : stderr;
import std.format : format;
import dscanner.analysis.config : StaticAnalysisConfig, Check, disabledConfig;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why double the tab?

@Vladiwostok Vladiwostok linked an issue Oct 3, 2024 that may be closed by this pull request
@RazvanN7 RazvanN7 merged commit f19c069 into Dlang-UPB:replace_libdparse Oct 5, 2024
17 checks passed
@Vladiwostok Vladiwostok deleted the vcall-in-ctor branch November 8, 2024 11:21
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

Successfully merging this pull request may close these issues.

Rebase VcallCtorChecker
2 participants