Commit Graph

4 Commits

Author SHA1 Message Date
Slava Pestov
28b0606b46 'Migrate' compiler crashers to Swift 4 2018-07-03 16:03:07 -07:00
Slava Pestov
5d2752f7d2 Run tests with -swift-version 4 by default
Some test now fail, so add an explicit -swift-version 3.
2018-06-19 23:24:19 -07:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Doug Gregor
aa3d024f8d [Type checker] Eliminate reuse of contextual archetypes in nested generics.
Prior to this change, nested generics always reused the archetypes of
either enclosing contexts. For example, given:

  struct X<T> {
    func f<U>(_: U) { }
  }

The generic environment for X.f(_:) would use the same archetype for T
as the generic environment X. This reuse allowed some sloppiness
within the implementation---one did not necessarily have to remember
to substitute entities that came from an immediate outer context---but
caused an annoying limitation that nested generics could not add any
constraints to an archetype that came from an outer scope. Worse, the
compiler would not always diagnose this as an error, leading to
constraints being silently dropped, as in the example from the
referenced radar (see the change to
test/Generics/associated_types.swift).

Now, build a fresh generic environment for each context that
introduces new generic parameters, with archetypes that are completely
separate from the archetypes of enclosing contexts.

Fixes rdar://problem/29207581.
2016-12-07 08:10:12 -08:00