Skip to content

Go runtime panic #3929

Closed
Closed

Description

@parrt

@chenquan reported bug here: #3834 (comment)

I found this problem in github.com/antlr/antlr4/runtime/Go/antlr v1.4.10. grammar:https://github.com/antlr/grammars-v4/tree/master/sql/mysql/Positive-Technologies

panic: interface conversion: antlr.PredictionContext is *antlr.EmptyPredictionContext, not *antlr.ArrayPredictionContext [recovered]
	panic: interface conversion: antlr.PredictionContext is *antlr.EmptyPredictionContext, not *antlr.ArrayPredictionContext [recovered]
	panic: interface conversion: antlr.PredictionContext is *antlr.EmptyPredictionContext, not *antlr.ArrayPredictionContext

Activity

  1. jimidle commented on Mar 15, 2023

    @jimidle
    Collaborator

    @parrt @chenquan I cannot reproduce this with the latest runtime code. I have some recollection of fixing this as part of some other code fix, but I cannot be sure. Code should refer to the PredictionContext interface rather than a specific instance. I believe that I fixed this as a byproduct of changing the code that calls mergeArrays, many months ago.

    I ran the code above and with the generated visitor it all works as I would expect and there is no panic.

    BTW - would you please report bugs with code, rather than a screenshot, so I can be sure I am running the same thing? Cheers :).

    I think that this can be closed.

  2. added this to the 4.12.1 milestone on Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions