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

Generate transform as a final def for cats-tagless friendliness #1588

Merged
merged 3 commits into from
Sep 30, 2024

Conversation

kubukoz
Copy link
Member

@kubukoz kubukoz commented Sep 24, 2024

Closes #1587

PR Checklist (not all items are relevant to all PRs)

  • Added unit-tests (for runtime code)
  • Added bootstrapped code + smoke tests (when the rendering logic is modified)
  • Added build-plugins integration tests (when reflection loading is required at codegen-time)
  • Added alloy compliance tests (when simpleRestJson protocol behaviour is expanded/updated)
  • Updated dynamic module to match generated-code behaviour
  • Added documentation
  • Updated changelog

@@ -51,7 +51,7 @@ private[codegen] object ModelLoader {
val modelsInJars = deps.flatMap { file =>
Using.resource(
// Note: On JDK13+, the second parameter is redundant.
FileSystems.newFileSystem(file.toPath(), null)
FileSystems.newFileSystem(file.toPath(), null: ClassLoader)
Copy link
Member Author

Choose a reason for hiding this comment

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

thought: this was causing trouble for my sbt (@ghostbuster91 also reported seeing this):

[error] [codegen2_12] /Users/kubukoz/projects/smithy4s/modules/codegen/src/smithy4s/codegen/internals/ModelLoader.scala:54:21: ambiguous reference to overloaded definition,
[error] [codegen2_12] both method newFileSystem in class FileSystems of type (x$1: java.nio.file.Path, x$2: java.util.Map[String, _])java.nio.file.FileSystem
[error] [codegen2_12] and  method newFileSystem in class FileSystems of type (x$1: java.nio.file.Path, x$2: ClassLoader)java.nio.file.FileSystem
[error] [codegen2_12] match argument types (java.nio.file.Path,Null)
[error] [codegen2_12]         FileSystems.newFileSystem(file.toPath(), null)
[error] [codegen2_12]                     ^
[error] [codegen2_12] one error found
[error] [codegen2_12] (codegen2_12 / Compile / compileIncremental) Compilation failed

I'm not sure why it's failing now, but I'm sure it was fine a couple months ago. Anyway, doesn't seem important enough to investigate.

@kubukoz kubukoz changed the title Generate transform as a final def for cats-tagless friendliness Generate transform as a final def for cats-tagless friendliness Sep 24, 2024
@kubukoz kubukoz marked this pull request as ready for review September 24, 2024 21:49
@Baccata Baccata merged commit 5f97dc1 into series/0.18 Sep 30, 2024
11 checks passed
@Baccata Baccata deleted the tagless-friendly-transform branch September 30, 2024 09:36
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.

Minor annoyance: can't derive cats-tagless typeclasses for Alg[_[_]]s
2 participants