mirror of
https://github.com/fluencelabs/aqua.git
synced 2024-12-04 22:50:18 +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
|
||||
|
||||
const FA = "constant"
|
||||
|
||||
func bar() -> string:
|
||||
<- " I am MyFooBar bar"
|
||||
-- exports3.aqua
|
||||
module Export declares *
|
||||
|
||||
func foo() -> string:
|
||||
<- "I am MyFooBar foo"
|
||||
|
||||
func foobar() -> []string:
|
||||
res: *string
|
||||
res <- foo()
|
||||
res <- bar()
|
||||
<- res
|
||||
|
||||
service ExpSrv("exp-srv"):
|
||||
baz()
|
||||
log: string -> ()
|
||||
<- "I am MyFooBar foo"
|
@ -1,32 +1,7 @@
|
||||
-- import.aqua
|
||||
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
|
||||
module Import
|
||||
|
||||
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:
|
||||
z <- Exp.f()
|
||||
q <- Export.Test.bar()
|
||||
OneMore "hello"
|
||||
OneMore.more_call()
|
||||
OM "ohmygod"
|
||||
OM.more_call()
|
||||
OM.consume(q)
|
||||
ExpSrv.log(C)
|
||||
ExpSrv.log(Exp.U)
|
||||
<- z
|
||||
z <- Export.foo()
|
||||
<- z
|
||||
|
@ -120,13 +120,13 @@ object HeaderSem {
|
||||
),
|
||||
(ctx, _) =>
|
||||
// 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(
|
||||
ctx.copy(declares =
|
||||
ctx.`type`("").map(_.fields.toNel.map(_._1).toList.toSet).getOrElse(Set.empty)
|
||||
)
|
||||
ctx.copy(module = Some(name.value), declares = all)
|
||||
)
|
||||
else
|
||||
} else
|
||||
(
|
||||
declareNames.map(n => n.value -> n) ::: declareCustom.map(a => a.value -> a)
|
||||
).map[ValidatedNec[SemanticError[S], Int]] { case (n, t) =>
|
||||
|
Loading…
Reference in New Issue
Block a user