Skip to content

Anything ending in _t is highlighted as if it was a valid type #2305

Open
@php4fan

Description

@php4fan

Describe the problem

I'm not fluent in C++.
I seemed to remember there was a type called address_t, so before I even googled it I just thought I'd try, and I wrote:

//......
int x = 8;
address_t idx = 0;
//...

As soon as I typed the "t" in "address_t", the supposed type name became highlighted in the same color as other correct types, like int in the line above.

So that made me think that it was correct.

Then I compiled, and it doesn't compile:

Compilation error: 'address_t' does not name a type

So I tried and replaced address_t with lkjsnldf_t and that gets highlighted too.

It's not because of the position either. If I write "lsdfnvlsdnv", it does not get highlighted.

Apparently anything ending in _t gets recognized as a valid type name.

To reproduce

Type:

kvbsv_t x = 0;

Expected behavior

kvbsv_t shouldn't get highlighted as a type name.

Arduino IDE version

2.2.1

Operating system

Linux

Operating system version

Manjaro Linux

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions