Skip to content

[test] Add test case for rdar://126583098 #79643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions test/Constraints/rdar126583098.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// RUN: %target-swift-emit-silgen %s -verify
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is well-typed code, and for parameter packs its a good idea anyway to make sure it gets all the way through SILGen, you could just put it in test/SILGen/ even though the original bug report was a Sema issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, can move to SILGen 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


protocol P {
var d: Double? { get }
}

// rdar://126583098 - Make sure this compiles.
func foo<each S: Sequence>(_ xss: (repeat (each S))) where repeat (each S).Element: P {
var n: Double = 0
for xs in repeat each xss {
for x in xs {
n += x.d ?? 0
}
}
}