Skip to content

Enhance "Identifier not found" when identifier exists but is missing {} #24893

Description

@mike-ward

Describe the feature

The error message when an identifier exists but is not used correctly should be enhanced.

Use Case

struct Data {
	id string
}

type DataCollection = Data

fn main() {
	data := DataCollection
}

V will return an error message saying the identifier DataCollection not found

Proposed Solution

Since the identifier clearly exists, a better message should include:

"Did you mean DataCollection{}?"

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Version used

V 0.4.11 efd36b8

Environment details (OS name and version, etc.)

V full version V 0.4.11 da3112e.efd36b8
OS macos, macOS, 15.5, 24F74
Processor 8 cpus, 64bit, little endian, Apple M2
Memory 0.18GB/8GB
V executable /Users/mike/Documents/github/v/v
V last modified time 2025-07-13 18:06:18
V home dir OK, value: /Users/mike/Documents/github/v
VMODULES OK, value: /Users/mike/.vmodules
VTMP OK, value: /tmp/v_501
Current working dir OK, value: /Users/mike/Documents/github/bug
env VFLAGS "-path @vlib
Git version git version 2.50.0
V git status weekly.2025.25-118-gefd36b89
.git/config present true
cc version Apple clang version 17.0.0 (clang-1700.0.13.5)
gcc version Apple clang version 17.0.0 (clang-1700.0.13.5)
clang version Apple clang version 17.0.0 (clang-1700.0.13.5)
tcc version tcc version 0.9.28rc 2024-02-05 HEAD@105d70f7 (AArch64 Darwin)
tcc git status thirdparty-macos-arm64 c8df4e27
emcc version N/A
glibc version N/A

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions