pkl-community / pkl-typescript

TypeScript language bindings for the Pkl programming language
https://www.npmjs.com/package/@pkl-community/pkl-typescript
Apache License 2.0
104 stars 1 forks source link

Extending an Abstract Class fails #18

Closed PaulJPhilp closed 8 months ago

PaulJPhilp commented 8 months ago

I am trying to extend an abstract class:

abstract class Event { type: String }

class feedbackUpdateEvent extends eventDef.Event { type = "feedbackUpdateEvent" }

I get the following error message: /Users/paul/projects/pkl-typescript/node_modules/@pkl-community/pkl-typescript/src/evaluator/evaluator.ts:97 throw new Error(resp.error) ^

Error: –– Pkl Error –– Cannot find property typescriptPackage in object of type pkl.typescript.internal.TypescriptMapping#Class.

127 | superClass.type.render(classInfo.typescriptPackage) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ at pkl.typescript.internal.ClassGen#interface[#2] (file:///Users/paul/projects/pkl-typescript/node_modules/@pkl-community/pkl-typescript/codegen/src/internal/ClassGen.pkl)

Did you mean any of the following? typescriptModule typescriptModuleShort type

jasongwartz commented 8 months ago

Thanks for the bug report, @PaulJPhilp !

Should be resolved by: https://github.com/pkl-community/pkl-typescript/pull/19

jasongwartz commented 8 months ago

Would you mind trying the latest commit from main, and see if it resolves the issue?

PaulJPhilp commented 8 months ago

I took Abstract Classes out for a drive today. They work great. Thank you!

On Thu, Mar 14, 2024 at 4:43 PM Jason Gwartz @.***> wrote:

Would you mind trying the latest commit from main, and see if it resolves the issue?

— Reply to this email directly, view it on GitHub https://github.com/pkl-community/pkl-typescript/issues/18#issuecomment-1998452806, or unsubscribe https://github.com/notifications/unsubscribe-auth/BA6V6ZVHX5G7GL62UOWY7JLYYIDY7AVCNFSM6AAAAABEVCW7POVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJYGQ2TEOBQGY . You are receiving this because you were mentioned.Message ID: @.***>