arrow-meta icon indicating copy to clipboard operation
arrow-meta copied to clipboard

[BUG] IllegalArgumentException when using custom refined type - 1.5.0-SNAPSHOT

Open brezinajn opened this issue 3 years ago • 1 comments

Describe the bug When trying to define my own refined types I'm getting an Exception java.lang.IllegalArgumentException: object is not an instance of declaring class : PositiveInt2.Companion.invoke using 1.5.0-SNAPSHOT

To Reproduce Steps to reproduce the behavior: Minimal repro here Should not be able to run.

Expected behavior User defined refined types should work correctly

Screenshots Not applicable

Environment (please complete the following information):

brezinajn avatar Jun 29 '21 13:06 brezinajn

Having another issue with the same sample during compile:

@JvmInline annotation is only applicable to value classes

What I have tried:

  • Launched same code in refined-types-compiler-plugin-demo module of arrow-meta-examples repository and got same error
  • Pasted it in refined-types-plugin tests and got same error
  • Disabled refined plugin and switched to a dependency and got successful compilation
  • Switched to data class and simple class and got successful compilation
  • Removed Refined from companion object and got successful compilation

Environment 

  • Kotlin version [eg. 1.5.0]: 1.5.0
  • Kotlin Intellij IDEA plugin version: 211-1.5.20-release-284-IJ7442.40
  • Intellij IDEA version: Build #IC-211.7442.40, built on June 1, 2021

ustitc avatar Jul 02 '21 20:07 ustitc