Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Bug: can't call a method from an importation module. #81

Open
mohanson opened this issue Dec 9, 2019 · 0 comments
Open

Bug: can't call a method from an importation module. #81

mohanson opened this issue Dec 9, 2019 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@mohanson
Copy link
Contributor

mohanson commented Dec 9, 2019

lib.ts

export class P {
    constructor() {}
    public draw() { console.log("Draw") }
}

main.ts

import * as lib from './lib'

function main(): number {
  const p = new lib.P();
  p.draw();
  return 0;
}

Build failed:

minits:prelude Starts /src/sandbox/main.ts
minits:prelude Create TmpDir /tmp/minits/3cdb5f9918c29df7109b8817edb0595a
minits:prelude Find depend /src/sandbox/lib.ts
minits:prelude Expand /src/sandbox/main.ts => /tmp/minits/3cdb5f9918c29df7109b8817edb0595a/output.layer0.ts
minits:prelude Expand /tmp/minits/3cdb5f9918c29df7109b8817edb0595a/output.layer0.ts => /tmp/minits/3cdb5f9918c29df7109b8817edb0595a/output.layer1.ts
minits:prelude Expand /tmp/minits/3cdb5f9918c29df7109b8817edb0595a/output.layer1.ts => /tmp/minits/3cdb5f9918c29df7109b8817edb0595a/output.layer2.ts
minits:prelude Expand /tmp/minits/3cdb5f9918c29df7109b8817edb0595a/output.layer2.ts => /tmp/minits/3cdb5f9918c29df7109b8817edb0595a/output.layer3.ts

/disk/src/minits/src/prelude.ts:812
      if (type.symbol.valueDeclaration.kind === ts.SyntaxKind.ClassDeclaration) {
                      ^
TypeError: Cannot read property 'valueDeclaration' of undefined
    at PreludeLayer4.genCallExpression (/disk/src/minits/src/prelude.ts:812:23)
    at PreludeLayer4.genExpression (/disk/src/minits/src/prelude.ts:341:21)
    at PreludeLayer4.genExpressionStatement (/disk/src/minits/src/prelude.ts:128:46)
    at PreludeLayer4.genStatement (/disk/src/minits/src/prelude.ts:363:21)
    at node.forEach.node (/disk/src/minits/src/prelude.ts:397:30)
    at Array.forEach (<anonymous>)
    at PreludeLayer4.genStatementList (/disk/src/minits/src/prelude.ts:393:10)
    at PreludeLayer4.genBlock (/disk/src/minits/src/prelude.ts:118:32)
    at PreludeLayer4.genFunctionDeclaration (/disk/src/minits/src/prelude.ts:224:24)
    at PreludeLayer4.genStatement (/disk/src/minits/src/prelude.ts:379:21)
@mohanson mohanson added the bug Something isn't working label Dec 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants