Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add consts that exercise circular imports #116

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ gulp.task("test:capnp-ts", ["build:capnp", "build:capnp-ts"], function() {
});

/** Run tests for the capnpc-ts schema compiler. */
gulp.task("test:capnpc-ts", ["build:capnp", "build:capnpc-ts"], function() {
gulp.task("test:capnpc-ts", function() {
return build(
"./packages/capnpc-ts/test/**/*.ts",
"packages/capnpc-ts/lib-test",
Expand Down
5 changes: 5 additions & 0 deletions packages/capnpc-ts/test/integration/import-bar.capnp
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
@0x9cbc682922e84ff9;

using Foo = import "import-foo.capnp";

const foo :Foo.Foo = ();

struct Baz {
const fooC :Foo.Foo = ();
bar @0 :Text;
}
3 changes: 3 additions & 0 deletions packages/capnpc-ts/test/integration/import-bar.capnp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

import * as capnp from "capnp-ts";
import { ObjectSize as __O, Struct as __S } from 'capnp-ts';
import { Foo } from "./import-foo.capnp";
export const _capnpFileId = "9cbc682922e84ff9";
export const FOO = new Foo((null as any), (null as any), (null as any));
export class Baz extends __S {
static readonly FOO_C = capnp.readRawPointer(new Uint8Array([0x10, 0x02, 0x40, 0x01, 0x00, 0x00]).buffer);
static readonly _capnp = { displayName: "Baz", id: "f2f28862b8e82db7", size: new __O(0, 1) };
getBar(): string { return __S.getText(0, this); }
setBar(value: string): void { __S.setText(0, value, this); }
Expand Down
3 changes: 3 additions & 0 deletions packages/capnpc-ts/test/integration/import-foo.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ using Bar = import "import-bar.capnp";

$Cxx.namespace("Initrode");

const baz :Bar.Baz = ();

struct Foo {
const bazC :Bar.Baz = ();
baz @0 :Bar.Baz;
}
2 changes: 2 additions & 0 deletions packages/capnpc-ts/test/integration/import-foo.capnp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import * as capnp from "capnp-ts";
import { ObjectSize as __O, Struct as __S } from 'capnp-ts';
import { Baz } from "./import-bar.capnp";
export const _capnpFileId = "fc552bdafbb0b889";
export const BAZ = new Baz((null as any), (null as any), (null as any));
export class Foo extends __S {
static readonly BAZ_C = capnp.readRawPointer(new Uint8Array([0x10, 0x02, 0x40, 0x01, 0x00, 0x00]).buffer);
static readonly _capnp = { displayName: "Foo", id: "f92e265d07c50136", size: new __O(0, 1) };
adoptBaz(value: capnp.Orphan<Baz>): void { __S.adopt(value, __S.getPointer(0, this)); }
disownBaz(): capnp.Orphan<Baz> { return __S.disown(this.getBaz()); }
Expand Down