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

Bring tutorial up-to-date with new query extensions and changes to query API #902

Closed
Tracked by #1209
fwendland opened this issue Sep 7, 2022 · 1 comment · Fixed by #1302
Closed
Tracked by #1209

Bring tutorial up-to-date with new query extensions and changes to query API #902

fwendland opened this issue Sep 7, 2022 · 1 comment · Fixed by #1302
Labels
bug Something isn't working console documentation Improvements or additions to documentation

Comments

@fwendland
Copy link
Collaborator

Stack trace

When using the console for v4.6.2 with the example file cpg-console/src/test/resources/array.cpp I'm getting:

[25] var expr = result.all<ArraySubscriptionExpression>().map { Triple(
        it.subscriptExpression.evaluate() as Int,
        it.arrayExpression.dfgFrom<ArrayCreationExpression>().first().capacity,
        it
    ) }
java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')
	at Line_26.<init>(Line_26.kts:2)

Thinking it might be a type change not reflected in the tutorial yet, I've tried changing the type to Long:

[26] var expr = result.all<ArraySubscriptionExpression>().map { Triple(
        it.subscriptExpression.evaluate() as Long,
        it.arrayExpression.dfgFrom<ArrayCreationExpression>().first().capacity,
        it
    ) }
java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.Long (java.lang.Integer and java.lang.Long are in module java.base of loader 'bootstrap')
	at Line_27.<init>(Line_27.kts:2)

... producing the opposite exception.

Unexpected behavior

Not applicable

Code of interest

Part of this repo

Extensions to the library, e.g. added or changed LanguageFrontends or Passes

Used default console configuration

Changes to the configuration

None

@fwendland fwendland added bug Something isn't working documentation Improvements or additions to documentation console labels Sep 7, 2022
@oxisto
Copy link
Member

oxisto commented Sep 8, 2022

We also need to re-work the tutorial to incorporate changes of #900

@oxisto oxisto changed the title Running into exceptions when trying console tutorial Bring tutorial up-to-date with new query extensions and changes to query API Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working console documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants