Skip to content

Conversation

Frotty
Copy link
Member

@Frotty Frotty commented Mar 15, 2019

Right now this throws a warning:

class A
  var i = 0
  construct()
    this.i = this.i // warning

However this will not:

init
  var i = 0
  i = i // no warning
  print(i)

It works for class members, but not locals. By debugging I found out that in the validator the namelinks for the local scenario don't have the same identity and thus the == check failed. It seems to work with the defs tho.
But idk if this is the 'correct' fix @peq 🤷‍♂️

@Frotty Frotty requested a review from peq March 15, 2019 00:36
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 61.487% when pulling e13c7df on fix-assignment-no-effect-warning into c33d0ca on master.

@peq peq merged commit 7b4b2df into master Mar 15, 2019
@peq peq deleted the fix-assignment-no-effect-warning branch March 15, 2019 20:29
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.

3 participants