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

x.vweb: $vweb.html() does not work #20204

Closed
Casper64 opened this issue Dec 17, 2023 · 0 comments
Closed

x.vweb: $vweb.html() does not work #20204

Casper64 opened this issue Dec 17, 2023 · 0 comments
Assignees
Labels
Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general. Unit: vweb Bugs/feature requests, that are related to the `vweb`.

Comments

@Casper64
Copy link
Member

Casper64 commented Dec 17, 2023

Describe the bug

Currently $vweb.html() is hardcoded to use vlib/vweb that makes it not possible to use for x.vweb.

Reproduction Steps

templates/index.html

<h1> Some html code</h1>

main.v

module main

import x.vweb

pub struct Context {
	vweb.Context
}

pub struct App {}

fn (app &App) index(mut ctx Context) vweb.Result {
	return $vweb.html()
}

fn main() {
	mut app := &App{}
	vweb.run[App, Context](mut app, 8080)
}

Expected Behavior

No error

Current Behavior

/tmp/v_1000/main.12203374303086460181.tmp.c:38416: warning: implicit declaration of function 'vweb__Context_html'
/tmp/v_1000/main.12203374303086460181.tmp.c:38416: error: field not found: Context
...
==================
(Use `v -cg` to print the entire error message)

builder error: 
==================
C error. This should never happen.

This is a compiler bug, please report it using `v bug file.v`.

https://github.com/vlang/v/issues/new/choose

You can also use #help on Discord: https://discord.gg/vlang

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.3 25777bd.687b33a

Environment details (OS name and version, etc.)

Linux

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@Casper64 Casper64 added the Bug This tag is applied to issues which reports bugs. label Dec 17, 2023
@spytheman spytheman self-assigned this Dec 29, 2023
@spytheman spytheman added Compiler: TCC Bugs/feature requests, that are related to compiling V programs with TCC. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general. Unit: vweb Bugs/feature requests, that are related to the `vweb`. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Status: Confirmed This bug has been confirmed to be valid by a contributor. and removed Compiler: TCC Bugs/feature requests, that are related to compiling V programs with TCC. labels Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. Unit: Compiler Bugs/feature requests, that are related to the V compiler in general. Unit: vweb Bugs/feature requests, that are related to the `vweb`.
Projects
None yet
Development

No branches or pull requests

2 participants