2017-08-08 38 views
1

在標題: Augment assignment and increment are not supported for local delegated properties ans inline properties - 我得到這樣一個下面這段代碼:加強分配和增量不支持本地授權性質ANS內嵌性能

var timer by someDelegate { } 
timer += someOtherValue 

它只要完全編譯爲一個半小時前。清理項目並重置Android Studio沒有幫助。

+0

你可以嘗試用'timer = timer + someOtherValue'替換它。 –

+0

提供更多問題的背景。 –

+0

我確認它不適用於我ether – voddan

回答

1

這是因爲此功能尚未實現,它不是一個錯誤,:)。這裏是在科特林的StackValue#L1815的源代碼1.1.3如下:

if (stackValue instanceof Delegate) { 
    //TODO need to support 
    throwUnsupportedComplexOperation(((Delegate) stackValue).variableDescriptor); 
} 

爲什麼所述屬性罐與+=工作,這是因爲Delegategetter/setter包裹,這意味着它是從客戶端代碼中不可見。

+0

嗯,我們看到了,但我仍然想知道爲什麼_只是停止working_(它工作了一個星期左右) - 或者,也許,爲什麼它在第一個地方工作! – Antek

+0

@Antek可能你在上週使用了最新版本的kotlin。 –

+0

這可能是怎麼回事?該項目使用的版本自7月13日以來一直穩定在1.1.3-2,我不記得任何更新通知 – Antek