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

compiler/checker: invalid convertion from 'html' to 'string' in return statement #931

Open
gazerro opened this issue Mar 4, 2022 · 0 comments
Assignees
Labels
needsDiscussion Something that must be discussed before going on tchecker Related to type checker

Comments

@gazerro
Copy link
Member

gazerro commented Mar 4, 2022

If an alias of the html type is used as global in templates:

var globals = native.Declarations{
	"HTML": reflect.TypeOf((*native.HTML)(nil)).Elem(),
}

Scriggo does not check that a typed string value cannot be converted to that type, for example this code does not fail:

{% var s = "a" %}
{{ HTML(s) }}
@gazerro gazerro added tchecker Related to type checker InvalidBehavior A valid or not valid code has an invalid behavior at runtime labels Mar 4, 2022
@gazerro gazerro self-assigned this Mar 4, 2022
@gazerro gazerro added needsDiscussion Something that must be discussed before going on and removed InvalidBehavior A valid or not valid code has an invalid behavior at runtime labels Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needsDiscussion Something that must be discussed before going on tchecker Related to type checker
Projects
None yet
Development

No branches or pull requests

1 participant