Commit Graph

11 Commits

Author SHA1 Message Date
Slava Pestov
3dc7a2decd Sema: Fix substMemberTypeWithBase() for non-generic typealias with 'where' clause
getContextSubstitutionMap() builds a substitution map for the generic signature of
the parent context, which is wrong if the typealias has its own 'where' clause.
2022-11-28 23:57:53 -05:00
Slava Pestov
dac8d666ee Stop passing -requirement-machine-{abstract,inferred,protocol}-signatures flags in tests
These flags are now no-ops.
2022-05-10 12:56:17 -04:00
Slava Pestov
b4b873332f Update -requirement-machine-* flags in various tests
- Don't pass 'verify' since it's now the default
- Update tests where diagnostics changed in a correct way to pass 'on' instead
- Delete compiler_scale/explicit_requirements_perf.swift since it's not testing anything with the requirement machine
2022-03-31 15:57:36 -04:00
Slava Pestov
a69ac78482 RequirementMachine: Rework PropertyMap::recordConflict() for GSB compatibility
We want to prefer explicit rules when an explicit rule and non-explicit
rule conflict. Since the explicit bit hasn't been computed yet when
building the property map, save conflicting rule pairs in a side table,
and then process them later in homotopy reduction.

The side table will also be useful for diagnostics later.
2022-02-17 19:40:58 -05:00
Alejandro Alonso
424802fb34 Revert SE-0283 (#34492)
Reverted despite build failures.
2020-10-29 17:32:06 -07:00
Azoy
fd950ebbf3 Implement Tuple Comparable Conformance
Add protocol witnesses for all Comparable requirements
2020-10-22 18:27:07 -04:00
Slava Pestov
6d84c18ba4 Sema: Check 'where' clause requirements on type witnesses
In the included test case, conformance checking of Wrapper : B would
pick up typealias Foo as a witness for the associated type B.Foo.

However, this typealias Foo is defined in a constrained extension where
T : A, and the underlying type references the associated type A.Foo
on T.

The resulting substitution is invalid when the conformance Wrapper : B
is used in a context where T does not conform to A.

Instead, we should ignore this typealias entirely, since it appears
in an unusable constrained extension.

Fixes <rdar://problem/60219705>, <https://bugs.swift.org/browse/SR-12327>,
<https://bugs.swift.org/browse/SR-12663>.
2020-08-15 01:43:13 -04:00
Anthony Latsis
d688710fb3 [Diag] Move invalid where clause on top-level decl diagnostic to Sema 2020-03-15 13:38:49 +03:00
Anthony Latsis
f762644175 Diagnose nested type references with unsatisfied requirements 2020-03-05 20:23:49 +03:00
Anthony Latsis
329e2c5a11 Make sure Self constraints in classes remain illegal 2020-03-05 20:21:27 +03:00
fischertony
6f08216936 Sema: Support where clauses on contextually generic decls 2020-03-05 04:37:12 +03:00