Fable icon indicating copy to clipboard operation
Fable copied to clipboard

python import error when using Erase with newtype pattern

Open joprice opened this issue 1 year ago • 1 comments

Description

When using Erase with a single member DU, the generated python throws an import error when trying to import the Erased type, whereas the same code works in JS.

Repro code

open Fable.Core

[<Erase>]
type X = X of int

// in some other file
let y(x: X) = x

Expected and actual results

The Erase annotation should replace the application and destructuring of the type with bare references, but ends up attemptig to import the non-existent type.

joprice avatar Dec 03 '24 23:12 joprice

Thanks for opening this issue. A fix for this should be ready soon 😊

dbrattli avatar Jun 24 '25 06:06 dbrattli