Open
Conversation
Contributor
tjpalmer
commented
Mar 25, 2026
- Maybe I'm good with the shaw-ai-fixes pr after these changes
Signed-off-by: Tom <tom@temper.systems>
Signed-off-by: Tom <tom@temper.systems>
tjpalmer
commented
Mar 25, 2026
| private val listedLength = FunctionCall(listedTypes.map { "$it::length" }, "$LISTED_TRAIT_NAME::len", hasGeneric = true) | ||
| private val listedMap = FunctionCall("Listed::map", "temper_core::listed::map", hasGeneric = true, fnIndex = -1) | ||
| private val listedMapDropping = | ||
| FunctionCall("Listed::mapDropping", "temper_core::listed::map_dropping", hasGeneric = true, fnIndex = -1) |
Contributor
Author
There was a problem hiding this comment.
Removed mapDropping because of #394. Removed the others because they aren't needed, because the default method conversion already works.
| ): List<Rust.Item> { | ||
| return when (member) { | ||
| is TmpL.GarbageStatement -> return listOf() | ||
| is TmpL.GarbageStatement -> translateGarbageStatement(member).toItem() // won't compile but that's ok |
Contributor
Author
There was a problem hiding this comment.
Per my request on the main pr, I replaced the listOf() things with translations that maybe help some in the generated code, even if the translations fail at compile or run time.
| val subject = when (val subj = ref.subject) { | ||
| is TmpL.Expression -> translateExpression(subj, avoidClone = true) | ||
| is TmpL.TypeName -> translateTypeName(subj) | ||
| is TmpL.TypeName -> translateTypeName(subj) // wrong but also shouldn't happen |
Contributor
Author
There was a problem hiding this comment.
I chose to leave this here but commented.
| // This branch is never expected, so some this translation is untested. | ||
| type.types.isEmpty() -> ANY_NAME.toId(pos) | ||
| type.types.size == 1 -> translateType(type.types.first(), inExpr = inExpr, isFlex = isFlex) | ||
| else -> Rust.ImplTraitType( |
Contributor
Author
There was a problem hiding this comment.
Again, left this here but commented.
|
|
||
| private fun translateUnsupportedStatement(statement: TmpL.Statement): Rust.ExprStatement = run { | ||
| Rust.ExprStatement(statement.pos, translateUnsupported(statement)) | ||
| } |
Contributor
Author
There was a problem hiding this comment.
Explicit garbage and other unsupported things end up here.
| } | ||
| } | ||
| Arc::new(result) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.