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

Exactly two top level variables produce no output #395

Open
Booksbaum opened this issue Mar 26, 2021 · 0 comments
Open

Exactly two top level variables produce no output #395

Booksbaum opened this issue Mar 26, 2021 · 0 comments

Comments

@Booksbaum
Copy link
Contributor

Exactly TWO top level variable produce no output:

export declare const c1: number;
export declare const c2: number;

==>

// ts2fable 0.8.0
module rec moduleName
open System
open Fable.Core
open Fable.Core.JS

BUT: There's no error displayed (in console)

ONE variable works:

export declare const c1: number;

==>

// ts2fable 0.8.0
module rec moduleName
open System
open Fable.Core
open Fable.Core.JS

let [<Import("c1","module")>] c1: float = jsNative

THREE variable work:

export declare const c1: number;
export declare const c2: number; 
export declare const c3: number;

==>

// ts2fable 0.8.0
module rec moduleName
open System
open Fable.Core
open Fable.Core.JS

let [<Import("c1","module")>] c1: float = jsNative
let [<Import("c2","module")>] c2: float = jsNative
let [<Import("c3","module")>] c3: float = jsNative

Type of variable doesn't matter:

export declare var v2: number;
export declare let l1: number;

==>

// ts2fable 0.8.0
module rec moduleName
open System
open Fable.Core
open Fable.Core.JS

Normal comments don't change behaviour:

// Comment
export declare var v2: number;
// Comment
export declare let l1: number;
// Comment

==> ∅ (same as above -- I don't need to repeat the same code again)

Doc Comments change behaviour:

/** Hello */
export declare var v2: number;
export declare let l1: number;

==>

// ts2fable 0.8.0
module rec moduleName
open System
open Fable.Core
open Fable.Core.JS

/// Hello
let [<Import("v2","module")>] v2: float = jsNative
let [<Import("l1","module")>] l1: float = jsNative

One Doc Comments with variable result in no output too:

/** Hello */
export declare var v2: number;

==> ∅

One Variable with something else produce output: (didn't try all possibilities -- just Type)

export declare var v2: number;
export declare type T = {};

==>

let [<Import("v2","module")>] v2: float = jsNative

type [<AllowNullLiteral>] T =
    interface end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant