Conversation
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>
| 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) |
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 |
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 |
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( |
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)) | ||
| } |
There was a problem hiding this comment.
Explicit garbage and other unsupported things end up here.
| } | ||
| } | ||
| Arc::new(result) | ||
| } |
|
@ShawSumma This is the pr where I back out some of the rust changes. |
ShawSumma
left a comment
There was a problem hiding this comment.
Approved, thanks for this and sorry for being slow