rafaavc opened a new issue, #2439:
URL: https://github.com/apache/fory/issues/2439

   ### Search before asking
   
   - [x] I had searched in the [issues](https://github.com/apache/fory/issues) 
and found no similar issues.
   
   
   ### Version
   
   Fory 0.11.1 (also tried with 0.11.2 and 0.10.3)
   Scala 3.3.6
   
   ### Component(s)
   
   Other
   
   ### Minimal reproduce step
   
   ```scala
   import scala.util.Try
   
   import org.apache.fory.Fory
   import org.apache.fory.format.encoder.Encoders
   import org.apache.fory.serializer.scala.ScalaSerializers
   
   object _ForyTest {
     private class ExampleKLong(
         val a: java.util.Map[java.lang.Long, java.lang.Long]
     )
   
     private class ExampleKString(
         val a: java.util.Map[java.lang.String, java.lang.String]
     )
   
     def main(args: Array[String]): Unit = {
       val fory = Fory
         .builder()
         .requireClassRegistration(false)
         .withScalaOptimizationEnabled(true)
         .build()
   
       ScalaSerializers.registerSerializers(fory)
   
       println(Try(Encoders.bean(classOf[ExampleKLong], fory)))
       // Failure(java.lang.UnsupportedOperationException: Unsupported type K 
for field key, seen type set is [_ForyTest$ExampleKLong])
       println(Try(Encoders.bean(classOf[ExampleKString], fory)))
       // Failure(java.lang.UnsupportedOperationException: Unsupported type K 
for field key, seen type set is [_ForyTest$ExampleKString])
     }
   }
   ```
   
   ### What did you expect to see?
   
   Expected the encoder derivation to succeed (like it does in Scala version 
3.6.4, for example).
   
   ### What did you see instead?
   
   ```
   [error] Exception in thread "main" java.lang.UnsupportedOperationException: 
Unsupported type K for field key, seen type set is [_ForyTest$ExampleKLong]
   [error]      at 
org.apache.fory.format.type.TypeInference.inferField(TypeInference.java:253)
   [error]      at 
org.apache.fory.format.type.TypeInference.inferField(TypeInference.java:233)
   [error]      at 
org.apache.fory.format.type.TypeInference.inferField(TypeInference.java:248)
   [error]      at 
org.apache.fory.format.type.TypeInference.inferField(TypeInference.java:134)
   [error]      at 
org.apache.fory.format.type.TypeInference.inferField(TypeInference.java:123)
   [error]      at 
org.apache.fory.format.type.TypeInference.inferSchema(TypeInference.java:76)
   [error]      at 
org.apache.fory.format.type.TypeInference.inferSchema(TypeInference.java:72)
   [error]      at 
org.apache.fory.format.type.TypeInference.inferSchema(TypeInference.java:62)
   [error]      at 
org.apache.fory.format.encoder.Encoders.bean(Encoders.java:76)
   [error]      at 
org.apache.fory.format.encoder.Encoders.bean(Encoders.java:72)
   [error]      at _ForyTest$.main(_ForyTest.scala:27)
   [error]      at _ForyTest.main(_ForyTest.scala)
   ```
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to