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

Add Support for Intersection Types in Scala 2 #3126

Closed
wants to merge 1 commit into from

Conversation

asr2003
Copy link
Contributor

@asr2003 asr2003 commented Sep 11, 2024

Changes Made:

  • Introduced special handling for Scala 2, where intersection types (with) require casting via asInstanceOf to ensure proper type alignment when applying handler aspects.
  • In Scala 3, intersection types (&) are natively supported and I think do not require casting, so the handler aspect is applied directly.

/claim #3112
fixes #3112

@asr2003 asr2003 changed the title fix Intersection Types in scala2 Add Support for Intersection Types in Scala 2 Sep 11, 2024
@asr2003
Copy link
Contributor Author

asr2003 commented Sep 11, 2024

@987Nabil How can we make a test to run in Scala2 Only to test the patch. I have test ready but stuck in how to make it run for Scala2 only.

I didn't see any @@Scala2Only something similiar like in ZIO

@asr2003 asr2003 marked this pull request as ready for review September 11, 2024 06:27
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 65.10%. Comparing base (f164c90) to head (26ed2cb).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...o-http/shared/src/main/scala/zio/http/Routes.scala 85.71% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3126      +/-   ##
==========================================
+ Coverage   65.09%   65.10%   +0.01%     
==========================================
  Files         161      161              
  Lines       10551    10557       +6     
  Branches     2024     1993      -31     
==========================================
+ Hits         6868     6873       +5     
- Misses       3683     3684       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@987Nabil 987Nabil left a comment

Choose a reason for hiding this comment

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

There is no test

@asr2003
Copy link
Contributor Author

asr2003 commented Sep 11, 2024

Just to confirm to test patch for scala2, I have waited. I will add it now

@987Nabil
Copy link
Contributor

Closing in favor of #3128

@987Nabil 987Nabil closed this Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attaching HandlerAspect to a Routes object with mulitple dependencies does not work (using Scala2)
3 participants