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

fixes #15130 #15141

Merged
merged 2 commits into from
Aug 1, 2020
Merged

fixes #15130 #15141

merged 2 commits into from
Aug 1, 2020

Conversation

Araq
Copy link
Member

@Araq Araq commented Aug 1, 2020

No description provided.

@archnim
Copy link
Contributor

archnim commented Aug 1, 2020

Hello Araq. I've taken notice that arithmetic operators dont support any pair of type. For example, this code:

var f = 78.0
var i = 78
f - i

gives me a mismatch error.

Is there any explanation to that, or is it an issue ?

@Araq
Copy link
Member Author

Araq commented Aug 1, 2020

import lenientops to get code like yours to compile but Nim is strict about these things for a good reason. Also ask on IRC or on our forum please.

@ghost
Copy link

ghost commented Aug 1, 2020

@archnim You shouldn't really ask in here, you should ask in the IRC/Discord or at least on the forum, but yes. by default you need to explicitly convert number types when you do mixed-type arithmetic, or import the https://nim-lang.org/docs/lenientops.html module

@archnim
Copy link
Contributor

archnim commented Aug 1, 2020

Sorry for asking that question here. I wanted to post on the nim forum, but I cant create an account. I'll ask it else where.

@Araq Araq merged commit 8e3f51f into devel Aug 1, 2020
@Araq Araq deleted the araq-fixes-15130 branch August 1, 2020 16:04
mildred pushed a commit to mildred/Nim that referenced this pull request Jan 11, 2021
* fixes nim-lang#15130

* you really have to copy from cursors
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.

2 participants