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

check error: wrong unicode character error #22427

Closed
enghitalo opened this issue Oct 6, 2024 · 1 comment · Fixed by #22462
Closed

check error: wrong unicode character error #22427

enghitalo opened this issue Oct 6, 2024 · 1 comment · Fixed by #22462
Assignees
Labels
Bug This tag is applied to issues which reports bugs. Good First Issue (easy task) This issue is suitable to be worked on by new contributors. Unit: Checker Bugs/feature requests, that are related to the type checker.

Comments

@enghitalo
Copy link
Contributor

enghitalo commented Oct 6, 2024

Describe the bug

wrong unicode character error

Reproduction Steps

	a := "\\u306aefgh"
	
	mut expected := "\\u306a"
	expected += "efgh"
	
 	assert a == expected

Expected Behavior

not error

Current Behavior

code.v:18:9: error: unicode character exceeds max allowed value of 0x10ffff, consider using a unicode literal (\u####)
   16 | //     println("\\u306ae")
   17 |     
   18 |     a := "\\u306aefgh"
      |            ~~~~~~~~
   19 |     
   20 |     mut expected := "\\u306a"

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.8 4f9df0d

Environment details (OS name and version, etc.)

Ubuntu

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.

@enghitalo enghitalo added the Bug This tag is applied to issues which reports bugs. label Oct 6, 2024
@esquerbatua
Copy link
Contributor

Seems like if you use two \ tries to parse one more value of the unicode character.
With only one it's working well:

a := "\u306aefgh"

mut expected := "\u306a"
expected += "efgh"

assert a == expected

@felipensp felipensp added Good First Issue (easy task) This issue is suitable to be worked on by new contributors. Unit: Checker Bugs/feature requests, that are related to the type checker. labels Oct 9, 2024
@felipensp felipensp self-assigned this Oct 9, 2024
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. Good First Issue (easy task) This issue is suitable to be worked on by new contributors. Unit: Checker Bugs/feature requests, that are related to the type checker.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants