Type missmatch in AST implementation

Hi i don’t understand why this is happening.
Screenshot 2022-07-12 131050

Screenshot 2022-07-12 131112
they are clearly same type but vs gives me error with this constructor , I have no clue why.
same with token, when I try to pass Token token to constructor it gives me errors. for that reason I never pass Token types in my constructors and I pass TokenKinds to it. i don’t know if it’s right way but tests work.
Can anyone explain why this is happening? do I need to create or overwrite token,localable classes?

There is not enough information to tell what is wrong. However one likely candidate is that you autocompleted Expression or Token and picked the wrong import. Check that the imports for Expression and Token in your classes are the ones from the implementation folder and the parser folder respectively.

Oh, I think you are right, guess auto-import made a mistake. Thanks alot.

Indeed, you should import tinycc.parser.Token, not the one from MARS.

1 Like