Skip to content

Conversation

WeijunDeng
Copy link

When a file changed, do not affect nodes with a fingerprint that have not changed.

@WeijunDeng
Copy link
Author

@artemcm

@WeijunDeng WeijunDeng changed the title When a file changed, do not affect nodes with a fingerprint that have not changed. [Incremental Builds]When a file changed, do not affect nodes with a fingerprint that have not changed. Oct 14, 2025
@artemcm
Copy link
Contributor

artemcm commented Oct 14, 2025

Could you please add a test of a scenario this affects?

@WeijunDeng
Copy link
Author

WeijunDeng commented Oct 15, 2025

Case 1

Before:

// A.swift
public class A {
  public let b = B()
}
// B.swift
public class B {
}

After:

// B.swift
public class B {
}
public class B_2 {
}

Now:
remark: Incremental compilation: Traced: interface of source file from B.swift.swiftdeps in B.swift -> interface of top-level name 'B' in B.swift -> implementation of source file from A.swift.swiftdeps in A.swift
Expected:
Do not recompile A.swift 🤔 (This PR can fix this case.)

Case 2

Before:

// A.swift
foo(123)
func foo(_: Any) { print("Hello Any") }
// B.swift
// func foo(_: Int) { print("Hello Int") }

After:

// B.swift
func foo(_: Int) { print("Hello Int") }

Now(Expected):
remark: Incremental compilation: Traced: interface of source file from B.swift.swiftdeps in B.swift -> interface of top-level name 'foo' in B.swift -> implementation of source file from A.swift.swiftdeps in A.swift

Case 3

Before:

// A.swift
func a() {
    if (1==1) {
    }
}
// B.swift
public class B {
//    static func == (lhs: B, rhs: B) -> Bool {
//        return true
//    }
}

After:

// B.swift
public class B {
    static func == (lhs: B, rhs: B) -> Bool {
        return true
    }
}

Now:
remark: Incremental compilation: Traced: interface of top-level name '==' in B.swift -> implementation of source file from A.swift.swiftdeps in A.swift
Expected:
Do not recompile A.swift 🤔 (This PR can not fix this case. I am debugging.)

@WeijunDeng
Copy link
Author

Could you please add a test of a scenario this affects?

please see above. @artemcm

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