CMakePP / CMakePPLang

Object-oriented extension to the CMake language.
http://cmakepp.github.io/CMakePPLang/
Apache License 2.0
11 stars 4 forks source link

Add pointer type covariance #112

Closed AutonomicPerfectionist closed 11 months ago

AutonomicPerfectionist commented 1 year ago

Is this pull request associated with an issue(s)? No.

Description

This PR further enriches the type system by allowing pointer types to be checked for covariance. What this means is that a desc* can now be used where a str* is expected, whereas previously such a conversion would not be possible due to the invariant nature of the implementation. As such, pointer type inference has been enabled, meaning that the type system will be able to infer whether a string is a pointer and recursively dereferences and infers its type. So now, if we have:

set(a_ptr TRUE)
cpp_type_of(a_type a_ptr)

The value of ${a_type} will be bool* instead of desc like it would be previously. Additionally, bool* will now be convertible to str*

TODOs

github-actions[bot] commented 11 months ago

🚀 [bumpr] Bumped! New version:v0.0.10 Changes:v0.0.9...v0.0.10

ryanmrichard commented 11 months ago

Unless I'm missing something, if this breaks CMaize or CMakeTests, it's probably those repose that need to change. Point being, I think we can merge this and deal with the fallout in other PRs.