You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've stumbled across this when implementing an indexed property through an interface. When adding properties to F# interfaces that have getters that require a value, the generated TypeScript interfaces have a different type signature than the classes implementing those
typeIReadOnlyIndexable<'key,'valuewhen'key:equality>=abstract Item: 'key -> 'value with get
typeDummyIndexable<'key,'valuewhen'key:equality>=interface IReadOnlyIndexable<'key, 'value>withmemberthis.Itemwith get key = failwith "asdf"typeIReadWriteIndexable<'key,'valuewhen'key:equality>=abstract Item: 'key -> 'value with get, set
typeDummyIndexableRW<'key,'valuewhen'key:equality>=interface IReadWriteIndexable<'key, 'value>withmemberthis.Itemwith get key = failwith "asdf"andset key value =()
Description
I've stumbled across this when implementing an indexed property through an interface. When adding properties to F# interfaces that have getters that require a value, the generated TypeScript interfaces have a different type signature than the classes implementing those
Repro code
See in the REPL: https://fable.io/repl/#?code=C4TwDgpgBAkgShAhgEwPIDsA2IbuRAD0QCNMIAeAcgGsIQAaKSgN0UwFdoB3ACwnSa0QALigQAjuzYBLUAD4oAXgBQUNVBIBnYACdEAY2CxgEALaiadKAFoFLNpyhdZPKAHMIwZctCQoAEXZTUxw8QhIyKiFGew5uPgFLETFJGXklVXVpdBMdADMDaHgkNCxQ-CJSCiSY1jiFZ2AeTPV1UzNiCB0oJulNADoYE1MW1rHG1w8jISUoAulMCagAIkRNZDzl718ihBQAdR1ZCFwKiOropjrHXn5BOlEJKUxZEAUVVq1dAyMhswsZrYrg5uC53J5GJpPNtwNBAsFyuEqnB9lE6LUQU4Evdkk80m8Mq1srkCvpdiVDsdTkjIjVgfUnC5Rq12qZOt1egM-iMxrzGU1wdMrIo5ogFktVutNsy+Yg8FAoUKQFBrtARQAKACUyiAA&html=Q&css=Q
Or see this code snippet:
Expected and actual results
The generated TypeScript code looks like this:
However, the interface has the property as
Item
, whereas the implementing classes haveget_Item
andset_Item
.The text was updated successfully, but these errors were encountered: