Skip to content

Small Sema fixes #6406

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 6 commits into from
Dec 20, 2016
Merged

Small Sema fixes #6406

merged 6 commits into from
Dec 20, 2016

Conversation

slavapestov
Copy link
Contributor

No description provided.

…resolved associated types

When building a generic signature, we would drop requirements
where the LHS or RHS was a DependentMemberType with an unresolved
associated type, however we didn't perform the same check for
DependentMemberTypes that are nested inside structural types.
…etypes from context

This could lead to verifier failures on invalid nesting of
generic types in generic functions.
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@@ -79,3 +79,13 @@ func takesAny(_ a: Any) {}
func badDiagnostic3() {
takesAny(Deli.self) // expected-error {{argument type 'Deli<_>.Type' does not conform to expected type 'Any'}}
}

// Crash with missing nested type inside concrete type
class OuterGeneric<T> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DougGregor do we have any radars for this one? :)

Copy link
Member

Choose a reason for hiding this comment

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

I bet we do... somewhere!

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

1 similar comment
@shahmishal
Copy link
Member

@swift-ci Please smoke test

@slavapestov slavapestov merged commit 50471e1 into swiftlang:master Dec 20, 2016
auto result = substitutions.insert(
{gp->getCanonicalType()->castTo<GenericTypeParamType>(),
outerEnv->mapTypeIntoContext(gp)});
genericEnv->mapTypeIntoContext(gp)});
Copy link
Member

Choose a reason for hiding this comment

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

Whoops, nice catch!

@@ -79,3 +79,13 @@ func takesAny(_ a: Any) {}
func badDiagnostic3() {
takesAny(Deli.self) // expected-error {{argument type 'Deli<_>.Type' does not conform to expected type 'Any'}}
}

// Crash with missing nested type inside concrete type
class OuterGeneric<T> {
Copy link
Member

Choose a reason for hiding this comment

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

I bet we do... somewhere!

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.

3 participants