gavr123456789 / Niva

Smalltalk like programming language
https://gavr123456789.github.io/niva-site
38 stars 2 forks source link

unresolved types in lambda type aliases #241

Open gavr123456789 opened 3 months ago

gavr123456789 commented 3 months ago
Project loadPackages: {"org.http4k:http4k-core:5.25.0.0" "org.http4k:http4k-core:3.37.0"}

Bind package: "org.http4k.server" content: [
    union ServerConfig port: Int =
    | SunHttp

    type Http4kServer
    Http4kServer start -> Http4kServer
]
Bind package: "org.http4k.core" content: [
    enum Status = OK | CREATED | ACCEPTED | NO_CONTENT | FOUND | BAD_REQUEST | NOT_FOUND

    type HttpHandler = [Request -> Response] // Request UNRESOLVED
    HttpHandler asServer: config::ServerConfig -> Http4kServer

    type Request
    Request query::String -> String 

    type Response status: Status
    Response body::String -> Response

]

app = [request::Request ->
    response = Response status: Status.OK
    query = request query: "name"
    response body: "Hello, " + query
]
gavr123456789 commented 3 months ago

need checking