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

runtime panic error when using string const #257

Closed
metaprem opened this issue Jun 16, 2019 · 3 comments
Closed

runtime panic error when using string const #257

metaprem opened this issue Jun 16, 2019 · 3 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@metaprem
Copy link

metaprem commented Jun 16, 2019

In Playground version 0.0.10, following const example program panics and shows

3.140000
V panic: println(NIL)

program:

const (
	PI    = 3.14
	WORLD = '世界'
)

println(PI)
println(WORLD)
@medvednikov
Copy link
Member

This is again caused by the unstable "no fn main" feature.

This works fine:

const (
	PI    = 3.14
	WORLD = '世界'
)

fn main() {
	println(PI)
	println(WORLD)
}

Will fix asap.

@joe-conigliaro
Copy link
Member

Personally I don't think that's a necessary feature anyway, Since it's not that hard to have a main function, and variables outside of main look kind of like they would be in some global scope also. Cant wait for it to be open sourced :P

@chanbakjsd chanbakjsd added the Bug This tag is applied to issues which reports bugs. label Jun 25, 2019
@Bowero
Copy link
Member

Bowero commented Jun 26, 2019

This is known and being worked on.

@Bowero Bowero closed this as completed Jun 26, 2019
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.
Projects
None yet
Development

No branches or pull requests

5 participants