Skip to content

fixes 25826; var type class parameter matches lvalues#25827

Open
demotomohiro wants to merge 1 commit into
nim-lang:develfrom
demotomohiro:fix-25826
Open

fixes 25826; var type class parameter matches lvalues#25827
demotomohiro wants to merge 1 commit into
nim-lang:develfrom
demotomohiro:fix-25826

Conversation

@demotomohiro
Copy link
Copy Markdown
Contributor

fixes #25826

This PR makes var type class parameters match any lvalues.
But it makes expr is var is always true.

@demotomohiro demotomohiro marked this pull request as ready for review May 19, 2026 09:29
@@ -0,0 +1,23 @@
# issue #25826

proc foo(x: var) = x = 123
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember the part of my spec that says "you can write var without any type at all"...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var type class is listed in Nim manual:
https://nim-lang.org/docs/manual.html#generics-type-classes
But it is not clear how it should work:
#9443 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

var type class parameters never match

2 participants