提交 12f7d463 编写于 作者: E Evgeny Gerashchenko

Fixed compilation of example-vfs project.

上级 963557f3
......@@ -26,7 +26,8 @@ fun main(args : Array<String>) {
FileSystem.addVirtualFileListener{ event ->
println(event)
if (event is VirtualFileChangedEvent) {
println("new file size is ${event.file.size()}")
// FIXME explicit type casting to avoid overload ambiguity (KT-1461)
println("new file size is ${(event as VirtualFileChangedEvent).file.size()}")
}
}
......
......@@ -50,9 +50,12 @@ internal object RefreshQueue {
/* Checks for changes in virtual file recursively, notifying listeners. */
private fun refreshFile(file : VirtualFile) {
FileSystem.assertCanWrite()
val fileInfo = FileSystem.fileToInfo[file.path]
assert(fileInfo != null)
if (fileInfo == null) {
return
}
if (file.isDirectory()) {
val fileToInfo = FileSystem.fileToInfo
val fileInfo = fileToInfo[file.path]
val oldChildren = fileInfo.children
val newChildren = file.children()
......@@ -69,9 +72,6 @@ internal object RefreshQueue {
commonChildren.foreach{ refreshFile(it) }
} else {
val fileInfo = FileSystem.fileToInfo[file.path]
assert(fileInfo != null)
val newModificationTime = file.modificationTime()
if (fileInfo.lastModified != newModificationTime) {
fileInfo.lastModified = newModificationTime
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册