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

Parsing of nested generics #4514

Closed
zhaar opened this issue May 27, 2016 · 2 comments
Closed

Parsing of nested generics #4514

zhaar opened this issue May 27, 2016 · 2 comments
Assignees

Comments

@zhaar
Copy link

zhaar commented May 27, 2016

Consider the following code:

class Three<A, B, C> {}
class Two<A, B> {}
class One<A> {}
Two<One<One<Integer>>, Integer> fn = null;

The processing pre-processor give us the error "Maybe too many >characters" even though the type signature is correct at line 4.

Interestingly enough both of those compile correctly:

Two<One<One<Integer> >, Integer> fn = null;
Two<Integer, One<One<Integer>>> fn = null;

Trying with Three gives us those results:

Three<One<One<Integer>>,Integer, Integer> fn = null; //doesn't compile
Three<Integer,One<One<Integer>>, Integer> fn = null; //doesn't compile
Three<Integer, Integer, One<One<Integer>>> fn = null; //compile

There definitely is a problem with how processing parses intermediate Type arguments.
tested with processing 3.1.1

@JakubValtar
Copy link
Contributor

Hi @zhaar, thanks for the report. This is a limitation of current ANTLR-based preprocessor and will be fixed when our plan to replace it by JDT-based preprocessor becomes a reality.

@benfry
Copy link
Contributor

benfry commented Jan 17, 2020

Fixed with benfry/processing4#1 and continued development happening at https://github.com/processing/processing4

@benfry benfry closed this as completed Jan 17, 2020
@processing processing locked as resolved and limited conversation to collaborators Jan 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants