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

Refactor results into common CompilationResult hierarchy #136

Merged
merged 4 commits into from
Feb 9, 2023

Conversation

ZacSweers
Copy link
Owner

This creates a new sealed CompilationResult hierarchy that includes subtypes for JS and JVM results. This should be a mostly source-compatible (but not binary compatible) change.

One important source compatibility change is that now JS files output is just called jsFiles rather than the borrowed JVM "classesAndResources" name from before.

Resolves #129

This creates a new sealed `CompilationResult` hierarchy that includes subtypes for JS and JVM results. This should be a mostly source-compatible (but not binary compatible) change.

One important source compatibility change is that now JS files output is just called `jsFiles` rather than the borrowed JVM "classesAndResources" name from before.
@ZacSweers
Copy link
Owner Author

@JakeWharton would be curious for your thoughts on this!

Copy link

@JakeWharton JakeWharton left a comment

Choose a reason for hiding this comment

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

Nice!

@@ -0,0 +1,67 @@
package com.facebook.buck.jvm.java.javax.com.tschuchort.compiletesting

Choose a reason for hiding this comment

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

Uhhhhh

Copy link
Owner Author

Choose a reason for hiding this comment

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

oh my

Copy link
Owner Author

Choose a reason for hiding this comment

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


/** Result of the compilation. */
@ExperimentalCompilerApi
sealed class CompilationResult(

Choose a reason for hiding this comment

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

Could be interface. Don't think you gain anything by using a class here except maybe the future pain of the rigidity of inheritance.

Copy link
Owner Author

Choose a reason for hiding this comment

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

@ZacSweers ZacSweers merged commit eae31fb into main Feb 9, 2023
@ZacSweers ZacSweers deleted the z/commonResult branch February 9, 2023 04:59
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.

All compilers should probably return a common Result type
2 participants