mirror of
https://github.com/fluencelabs/aqua.git
synced 2025-03-15 11:40:50 +00:00
fix bug (#289)
This commit is contained in:
parent
91038851a5
commit
49da2a07ad
@ -1,19 +1,5 @@
|
|||||||
module Export.Test declares foobar, foo, bar, ExpSrv, FA
|
-- exports3.aqua
|
||||||
|
module Export declares *
|
||||||
const FA = "constant"
|
|
||||||
|
|
||||||
func bar() -> string:
|
|
||||||
<- " I am MyFooBar bar"
|
|
||||||
|
|
||||||
func foo() -> string:
|
func foo() -> string:
|
||||||
<- "I am MyFooBar foo"
|
<- "I am MyFooBar foo"
|
||||||
|
|
||||||
func foobar() -> []string:
|
|
||||||
res: *string
|
|
||||||
res <- foo()
|
|
||||||
res <- bar()
|
|
||||||
<- res
|
|
||||||
|
|
||||||
service ExpSrv("exp-srv"):
|
|
||||||
baz()
|
|
||||||
log: string -> ()
|
|
@ -1,32 +1,7 @@
|
|||||||
-- import.aqua
|
module Import
|
||||||
module Import.Test
|
|
||||||
import foobar, FA as C, ExpSrv from "export.aqua"
|
|
||||||
|
|
||||||
use foo as f, FA as U from "export.aqua" as Exp
|
|
||||||
use foo as f, FA from "export.aqua" as Exp1
|
|
||||||
|
|
||||||
use "export.aqua"
|
use "export.aqua"
|
||||||
|
|
||||||
import "gen/OneMore.aqua"
|
|
||||||
|
|
||||||
import OneMore as OM from "gen/OneMore.aqua"
|
|
||||||
|
|
||||||
export consts as main--, foobar as barfoo
|
|
||||||
|
|
||||||
func consts():
|
|
||||||
ExpSrv.log(C)
|
|
||||||
ExpSrv.log(Exp.U)
|
|
||||||
ExpSrv.log(Exp1.FA)
|
|
||||||
ExpSrv.log(Export.Test.FA)
|
|
||||||
|
|
||||||
func foo_wrapper() -> string:
|
func foo_wrapper() -> string:
|
||||||
z <- Exp.f()
|
z <- Export.foo()
|
||||||
q <- Export.Test.bar()
|
<- z
|
||||||
OneMore "hello"
|
|
||||||
OneMore.more_call()
|
|
||||||
OM "ohmygod"
|
|
||||||
OM.more_call()
|
|
||||||
OM.consume(q)
|
|
||||||
ExpSrv.log(C)
|
|
||||||
ExpSrv.log(Exp.U)
|
|
||||||
<- z
|
|
||||||
|
@ -120,13 +120,13 @@ object HeaderSem {
|
|||||||
),
|
),
|
||||||
(ctx, _) =>
|
(ctx, _) =>
|
||||||
// When file is handled, check that all the declarations exists
|
// When file is handled, check that all the declarations exists
|
||||||
if (declareAll.nonEmpty)
|
if (declareAll.nonEmpty) {
|
||||||
|
val all =
|
||||||
|
ctx.`type`("").map(_.fields.toNel.map(_._1).toList.toSet).getOrElse(Set.empty)
|
||||||
validNec(
|
validNec(
|
||||||
ctx.copy(declares =
|
ctx.copy(module = Some(name.value), declares = all)
|
||||||
ctx.`type`("").map(_.fields.toNel.map(_._1).toList.toSet).getOrElse(Set.empty)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
else
|
} else
|
||||||
(
|
(
|
||||||
declareNames.map(n => n.value -> n) ::: declareCustom.map(a => a.value -> a)
|
declareNames.map(n => n.value -> n) ::: declareCustom.map(a => a.value -> a)
|
||||||
).map[ValidatedNec[SemanticError[S], Int]] { case (n, t) =>
|
).map[ValidatedNec[SemanticError[S], Int]] { case (n, t) =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user