#18 Should not allow instVar and BlockClosure arg with same name

クローズ
8 年 前nero によって開かれました · 0 コメント
Admin of lolg.it8 年 前 にコメントしました

Originally at 2011-08-26T18:21:07Z by Laurent Laffont closed at 2012-09-25T22:25:02Z

In JTalk I can write:

TestCase subclass: #CompilerTest
instanceVariableNames: 'dummy'
category: 'Kernel-Tests'


CompilerTest>>#testBlockVSInstVar
dummy := 3.

1 to: 1 do: [:dummy| self assert: 1 = dummy].

so dummy in the block equals 3 and not 1.

In Pharo it's not possible to have a block arg with same name as a instVar

Originally at 2011-08-26T18:21:07Z by Laurent Laffont closed at 2012-09-25T22:25:02Z In JTalk I can write: TestCase subclass: #CompilerTest instanceVariableNames: 'dummy' category: 'Kernel-Tests' CompilerTest>>#testBlockVSInstVar dummy := 3. 1 to: 1 do: [:dummy| self assert: 1 = dummy]. so dummy in the block equals 3 and not 1. In Pharo it's not possible to have a block arg with same name as a instVar
nero 7 年 前 に閉じられました
Herby Vojčík この課題がコミット 5 年 前 から参照されました
会話に参加するには サインイン してください。
ラベルなし
マイルストーンなし
担当者なし
1 参加者
読み込み中…
キャンセル
保存
まだコンテンツがありません