Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / pas2js / 2022-11

dts2pas cannot handle plain interfaces

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ng Pheng Siong

Hi Michael and all,

I've used dts2pas to create a Pascal unit for OnsenUI. It seems dts2pas currently does not support 'plain' interfaces. Line 1237 of onsenui.d.ts declares following:

interface OnsListElement extends HTMLElement {
<stuff>
}

Then, from line 1283 onwards:

  interface OnsOptions {
    parentScope?: Object;
  }
  interface AlertOptions {
    <stuff>
  }

In the output generated by dts2pas, class TOnsListItemElement exists, corresponding to the line 1237 declaration mentioned above, but the 'plain' interfaces OnsOptions and so on aren't generated. The Pascal source fails to compile:

  Pas2JS Compiler version 2.3.1 [2022/10/05] for Linux x86_64
  Copyright (c) 2022 Free Pascal team.
  units/onsenui.pas(14,14) Error: Forward type not resolved "TOnsOptions"
  Fatal: Compilation aborted

OnsenUI is v2.12.6, installed by npm. pas2js is this version:

commit 426000efcd3ddeb3b3dc0649cb30f9e3aa82b9c3 (HEAD -> main, origin/main, origin/HEAD) Author: Micha?l Van Canneyt
Date: Tue Oct 4 09:41:27 2022 +0200

* Reinstate check for non-empty text content

Is this expected to work? Should I raise an issue in Gitlab?

Pheng

Reply by email

Michael Van Canneyt
to Ng Pheng Siong
Ng Pheng Siong wrote 38 lines
Hi Michael and all, I've used dts2pas to create a Pascal unit for OnsenUI. It seems dts2pas currently does not support 'plain' interfaces. Line 1237 of onsenui.d.ts declares following: interface OnsListElement extends HTMLElement { <stuff> } Then, from line 1283 onwards: interface OnsOptions { parentScope?: Object; } interface AlertOptions { <stuff> } In the output generated by dts2pas, class TOnsListItemElement exists, corresponding to the line 1237 declaration mentioned above, but the 'plain' interfaces OnsOptions and so on aren't generated. The Pascal source fails to compile: Pas2JS Compiler version 2.3.1 [2022/10/05] for Linux x86_64 Copyright (c) 2022 Free Pascal team. units/onsenui.pas(14,14) Error: Forward type not resolved "TOnsOptions" Fatal: Compilation aborted OnsenUI is v2.12.6, installed by npm. pas2js is this version: commit 426000efcd3ddeb3b3dc0649cb30f9e3aa82b9c3 (HEAD -> main, origin/main, origin/HEAD) Author: Micha?l Van Canneyt Date: Tue Oct 4 09:41:27 2022 +0200 * Reinstate check for non-empty text content Is this expected to work? Should I raise an issue in Gitlab?

This is supposed to work, so yes, please file an issue. In your issue, please include a link to the OnsenUI dts (or the dts itself), so I don't need to search for it :-)

Michael.

Reply by email