-
Notifications
You must be signed in to change notification settings - Fork 66
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
Types for list, map and set #1808
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve of these changes in general.
Some nitpicking:
- I'm not really fond of using
objectType
to create built-in type nodes, as we already discussed. I'm aware, that theobjectType
function internally checks for built-in types (usingprimitiveTypeNames
which feels wrong), but I'd prefer the frontend to be cleaner in this regard and useobjectType
when handling code likefoo = Foo()
and the languagesbuiltInTypes
for stuff that's build into the language. However, this would be too much for this PR and an additional PR (or issue) seems to be good here. Also, there are way too manytypeOf
, ... or similar functions. I'm confused which one to use. - (Not really relevant as this PR is super small, but I would prefer to have this split in two PRs for the future, as it does 2 things: implement the new stuff in cpg-core and then use the new stuff in the language frontends. These new concepts should then be implemented for all other supported languages in respective PRs, too.)
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/types/SecondOrderType.kt
Outdated
Show resolved
Hide resolved
cpg-language-python/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/python/PythonLanguage.kt
Show resolved
Hide resolved
FYI there is the |
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/types/ListType.kt
Show resolved
Hide resolved
aa6473a
to
17dcab4
Compare
This PR adds Type classes for
List
,Map
andSet
.