Skip to content

Add GetSignedType and GetUnsignedType#1010

Open
Ivka-F wants to merge 1 commit into
compiler-research:mainfrom
Ivka-F:jank-merge-v1
Open

Add GetSignedType and GetUnsignedType#1010
Ivka-F wants to merge 1 commit into
compiler-research:mainfrom
Ivka-F:jank-merge-v1

Conversation

@Ivka-F

@Ivka-F Ivka-F commented May 13, 2026

Copy link
Copy Markdown

This PR upstreams two new type utility functions from the jank-lang/CppInterOp fork,
originally authored by @jeaye.

  • GetSignedType — returns the signed counterpart of an integral type (e.g. unsigned int -> int). Returns the type unchanged if it has no signed counterpart.
  • GetUnsignedType — returns the unsigned counterpart of an integral type (e.g. int -> unsigned int). Returns the type unchanged if it has no unsigned counterpart.

Both functions follow the existing API conventions (INTEROP_TRACE, INTEROP_RETURN, null checks) and include unit tests in TypeReflectionTest.cpp covering all integral type cases including __int128.

These are purely additive — no existing behavior is changed.

@codecov

codecov Bot commented May 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.06%. Comparing base (ed3696d) to head (653a6bb).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1010      +/-   ##
==========================================
+ Coverage   85.89%   86.06%   +0.16%     
==========================================
  Files          15       15              
  Lines        4971     5031      +60     
==========================================
+ Hits         4270     4330      +60     
  Misses        701      701              
Files with missing lines Coverage Δ
lib/CppInterOp/CppInterOp.cpp 89.56% <100.00%> (+0.23%) ⬆️
Files with missing lines Coverage Δ
lib/CppInterOp/CppInterOp.cpp 89.56% <100.00%> (+0.23%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Vipul-Cariappa Vipul-Cariappa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment thread lib/CppInterOp/CppInterOp.cpp
@Ivka-F Ivka-F force-pushed the jank-merge-v1 branch 2 times, most recently from 4e73fa8 to 83788ec Compare May 24, 2026 20:13
@Vipul-Cariappa

Copy link
Copy Markdown
Collaborator

Can you please fix the Ubuntu CI failures? You may want to use macros for the LLVM version, and if CppInterOp is built with Cling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants