mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
swift-module-digester: diagnose let to var changes and vice versa as ABI breaking.
This commit is contained in:
@@ -760,13 +760,19 @@ static void detectDeclChange(NodePtr L, NodePtr R, SDKContext &Ctx) {
|
||||
// Detect re-ordering if they're from structs with a fixed layout.
|
||||
auto *LV = dyn_cast<SDKNodeDeclVar>(L);
|
||||
auto *RV = dyn_cast<SDKNodeDeclVar>(R);
|
||||
if (LV && RV &&
|
||||
LV->hasFixedBinaryOrder() && RV->hasFixedBinaryOrder() &&
|
||||
LV->getFixedBinaryOrder() != RV->getFixedBinaryOrder()) {
|
||||
Ctx.getDiags().diagnose(SourceLoc(), diag::decl_reorder,
|
||||
LV->getScreenInfo(),
|
||||
LV->getFixedBinaryOrder(),
|
||||
RV->getFixedBinaryOrder());
|
||||
if (LV && RV) {
|
||||
if (LV->hasFixedBinaryOrder() && RV->hasFixedBinaryOrder() &&
|
||||
LV->getFixedBinaryOrder() != RV->getFixedBinaryOrder()) {
|
||||
Ctx.getDiags().diagnose(SourceLoc(), diag::decl_reorder,
|
||||
LV->getScreenInfo(),
|
||||
LV->getFixedBinaryOrder(),
|
||||
RV->getFixedBinaryOrder());
|
||||
}
|
||||
if (LV->isLet() != RV->isLet()) {
|
||||
Ctx.getDiags().diagnose(SourceLoc(), diag::var_let_changed,
|
||||
LV->getScreenInfo(),
|
||||
LV->isLet());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user