Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions lib/AST/GenericSignatureBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4361,6 +4361,8 @@ ConstraintResult GenericSignatureBuilder::addTypeRequirement(

if (subjectType->is<DependentMemberType>()) {
subjectType = resolveDependentMemberTypes(*this, subjectType);
} else {
subjectType = ErrorType::get(subjectType);
}

auto invalidConstraint = Constraint<Type>(
Expand Down
6 changes: 6 additions & 0 deletions validation-test/compiler_crashers_2_fixed/rdar58941114.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// RUN: not %target-swift-frontend %s -typecheck

class C {}
protocol Foo {
associatedtype X where C: X
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be better if we had a test for this in tests/ to check the diagnostic message makes sense

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(I see it makes sense: qq.swift:3:28: error: type 'C' constrained to non-protocol, non-class type 'Self.X' but it would be good to ensure it doesn't regress and surface error types or something)

}