Skip to content

Import attribute handling #1392

@Jooseppi12

Description

@Jooseppi12

Consider the following code:

[<Import ("myFunction", "myModule")>]
let myFunction (str: string) = X<unit>

The above would describe a function in F# that would be translated to a call myFunction from the myModule import. At the moment the above code does not compile, as the X is failing, as this Import is not treated as an inline.

Known workaround at the moment is to apply an inline as well, like this:

[<Import ("myFunction", "myModule"); Inline "$import($str)">]
let myFunction (str: string) = X<unit>

Ideally we don't want to rely on the Inline to make this work, just applying the import attribute should work.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

v7.0

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions