Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

construction of generic class conflicts with "less than" operator in if condition #184

Closed
felixhao28 opened this issue Jan 4, 2019 · 4 comments

Comments

@felixhao28
Copy link

Description

image

class A {
    void f() {
        int X = 5;
        if (X < 100)
            isTokenPerNode = false;
        for (int A : list) {
            // ...
        }
        if (new HashSet<String>().size() < 100)
            isTokenPerNode = false;
        for (int A : list) {
            // ...
        }
    }
}

If the condition contains a generic type, the comparator "<" won't be parsed correctly. And it also breaks the rest of the file.

Version:
7c3d0d3

@sadikovi
Copy link
Contributor

sadikovi commented Jan 4, 2019

Relates to #132

@felixhao28
Copy link
Author

OK. Feel free to close it if it's duplicate.

@Vigilans
Copy link
Contributor

Vigilans commented Dec 2, 2019

This issue has been solved in #214:
image

It is actually a variant of #213: The dot punctuation '.' didn't stop the new expression.

Effect of removing the dot operator from end regex:
image

@sadikovi
Copy link
Contributor

sadikovi commented Sep 8, 2020

I double checked that this issue has been fixed in master.

@sadikovi sadikovi closed this as completed Sep 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants