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

Possibly undefined symbol for .length #587

Open
azihassan opened this issue Aug 18, 2020 · 4 comments
Open

Possibly undefined symbol for .length #587

azihassan opened this issue Aug 18, 2020 · 4 comments

Comments

@azihassan
Copy link

Desktop (please provide environment info):

  • OS: Ubuntu 18.04 64 bits
  • IDE: Intellij 2020.2
  • Plugin Version 1.25

D compiler and tools (please provide version numbers):

  • dmd: 2.093.0
  • dub: 1.22.0
  • dcd: 0.13.1
  • dscanner: 0.10.0-3-g2a1f96f

Describe the problem
I'm getting a "Possibly undefined symbol" warning for the .length property.

void main(string[] args)
{
    args.length.writeln;
}

Screenshots
2020-08-18-200042_1366x744_scrot

DCD configuration:
2020-08-18-200200_1026x744_scrot

Additional context
Autocompletion works for .length, but the warning is still present.

@azihassan azihassan added the bug label Aug 18, 2020
@SingingBush
Copy link
Member

The way to setup the plugin is just to ensure that phobos and druntime are being picked up as sourcepaths when you select DMD as an sdk:

intellij-dlang-setup-phobos-and-druntime

so you're getting auto completion because DCD is aware of phobos/druntime but the plugin itself has not picked those paths up. Also, if they're configured as sourcepaths you will not need to add them as flags to DCD.

@azihassan
Copy link
Author

Thanks for the reply. I checked the SDK settings and it turns out that the paths are indeed defined :

image

But the problem persists. I also tried removing the flags from DCD, rebuilding, restarting Intellij. Am I missing someting ?

@tsbockman
Copy link

so you're getting auto completion because DCD is aware of phobos/druntime but the plugin itself has not picked those paths up. Also, if they're configured as sourcepaths you will not need to add them as flags to DCD.

The .length property of built-in slices is not from druntime or phobos; it is a language feature. Check out these sections in the spec: Array Properties and Properties.

Similarly, there are also some unrecognized __traits, like identifier; see Traits.

@therealbluepandabear
Copy link
Contributor

Just wanted to mention I had an issue in which I got an undefined symbol for everything and I had to permanently disable that inspection as it just wasn't working properly.

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

4 participants