Commit Graph

49 Commits

Author SHA1 Message Date
Slava Pestov
3749a0066d Add a couple of crashers 2017-04-23 01:49:02 -07:00
Doug Gregor
8dfc25edc7 [GSB] Filter out conformance constraints derived from concrete conformance.
When an otherwise abstract conformance constraint is derived from a
concrete conformance, retain the abstract conformance by removing the
requirement source that involves the concrete conformance. This
eliminates our reliance on the concrete conformance, which is not
retained as part of the generic signature.

Fixes rdar://problem/31163470 and rdar://problem/31520386.
2017-04-16 23:05:23 -07:00
Doug Gregor
44c2f849d6 [Type checker] Continue validating requirements after an error.
We want to validate both type in same-type or conformance constraints,
even when the first type is ill-formed, so we don't leave null types
around for later phases to crash on.

Fixes rdar://problem/31093854.
2017-04-05 14:05:59 -07:00
Slava Pestov
9db6b10059 AST: Targeted fix for conformance lookup issue
When substituting a type like T.A.B where A and B are
associated types and the conformance requirement on T.A
is implied by conformance requirements on T, we would
crash.

The problem is that we have no way of representing an
abstract conformance with nested concrete types.

This patch adds a workaround that we can live with until
ConformanceAccessPaths are plumbed through all the way.

Fixes <rdar://problem/30737546> and
<https://bugs.swift.org/browse/SR-3500>.

Possibly fixes <rdar://problem/31334245>.
2017-04-03 15:35:10 -07:00
Slava Pestov
19b12aa3b1 Sema: Fix convenience init delegation to a convenience init in a generic base class
While in the constraint system, the delegation is modeled as
returning an instance of the derived class, in the AST we type
the reference as returning an instance of the base class, and
insert a downcast, because in SILGen we're calling the base
class initializer which is typed as returning the base class.

This bit of fixup logic wasn't happening if the base class was
generic, and so we were not inserting the cast, which would
crash in SILGen with an assert.

Fixes <rdar://problem/31000248>.
2017-03-26 00:00:53 -07:00
Slava Pestov
3ef5ef0ac9 Merge pull request #8232 from slavapestov/two-more-crashers
Last two crashers for the evening
2017-03-21 02:25:57 -07:00
Slava Pestov
e8413ba134 Merge pull request #8229 from slavapestov/another-protocol-typealias-crasher-yay
Add another crasher with protocol typealiases
2017-03-21 02:02:16 -07:00
Slava Pestov
6019754b54 Last two crashers for the evening 2017-03-21 01:45:53 -07:00
Slava Pestov
47a0cb1861 Add another crasher with protocol typealiases 2017-03-21 00:21:21 -07:00
Slava Pestov
a3a290eb60 Mangling: Fix bug in the logic for dropping same-type constraints
It's not correct to drop a constraint if one of the two types
structurally contains generic parameters at the method depth.
2017-03-21 00:15:18 -07:00
Slava Pestov
a3067a19bd Add a couple of crashers 2017-03-20 23:15:23 -07:00
John McCall
22382f7e15 Reimplement associated conformance IRGen using Doug's conformance
access path work.

Having done so, simplify archetype TypeInfos by removing a now-
unnecessary layer of abstraction.
2017-03-14 03:48:10 -04:00
Slava Pestov
9d22ff0edc Add a crasher 2017-02-26 22:17:31 -08:00
Slava Pestov
412c71d8c2 Add some crashers
One is already fixed so let's make sure it won't regress again; the
other two are pending some improvements to GenericSignatureBuilder.
2017-02-25 16:17:28 -08:00
Slava Pestov
5f9fe6fa2c SILGen: Fix crash with non-scalar casts requiring re-abstraction
This might only come up in invalid code, but for example
casting a function type to String would trigger it.
2017-01-03 19:05:41 -08:00
Slava Pestov
ad01c1e929 SILGen: Implement missing function conversions from tuples to Any
Fixes <https://bugs.swift.org/browse/SR-3267> and
<rdar://problem/22465834>.
2017-01-03 19:05:40 -08:00
Slava Pestov
e063e8297c Sema: Some fixes for the ITC
- In functions called from resolveType(), consistently
  use a Type() return value to indicate 'unsatisfied
  dependency', and ErrorType to indicate failure.

- Plumb the unsatisfiedDependency callback through the
  resolution of the arguments of BoundGenericTypes, and
  also pass down the options.

- Before doing a conformance check on the argument of a
  BoundGenericType, kick off a TypeCheckSuperclass request
  if the type in question is a class. This ensures we don't
  recurse through NominalTypeDecl::prepareConformanceTable(),
  which wants to see a class with a valid superclass.

- The ResolveTypeOfDecl request was assuming that
  the request was satisfied after calling validateDecl().
  This is not the case when the ITC is invoked from a
  recursive call to validateDecl(), hack this up by returning
  *true* from isResolveTypeDeclSatisfied(); otherwise we
  assert in satisfy(), and we can't make forward progress
  in this case anyway.

- Fix a bug in cycle breaking; it seems if we don't invoke
  the cycle break callback on all pending requests, we end
  up looping forever in an outer call to satisfy().

- Remove unused TR_GlobalTypeAlias option.
2016-12-09 17:36:49 -08:00
practicalswift
e8fad3a2a1 [gardening] Mark crash cases as fixed. 2016-12-09 21:46:43 +01:00
practicalswift
1d47f657eb [gardening] Rename and move crash case to correct dir.
* validation-test/compiler_crashers_2/ is recommended for manually added crashes like this one
* validation-test/compiler_crashers/ is synchronized against https://github.com/practicalswift/swift-compiler-crashes

This crasher was added in ff830ce4aa.
2016-12-08 18:22:11 +01:00
Pavel Yaskevich
d111e9b4be [Diagnostics] When building a subscript don't assume that overload is always present
This handles situation when overload for the subscript hasn't been resolved
by constraint solver, such might happen, for example, if solver was allowed to
produce solutions with free or unresolved type variables (e.g. when running diagnostics).

Resolves: <rdar://problem/27329076>, <rdar://problem/28619118>, <rdar://problem/2778734>.
2016-11-28 19:18:44 -08:00
David Farler
b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00
Jacob Bandes-Storch
a272b4640f [test] Add crasher in ResultPlanner::planTupleIntoIndirectResult 2016-11-24 14:14:09 -08:00
Daniel Duan
830c6de8be [crasher] add a crasher 2016-05-16 21:51:34 -07:00
Mark Lacey
eb1c4dc240 Fix two validation tests that require asserts. 2016-04-16 16:10:51 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
gregomni
e17e7ab8ae Make resolveTypeInContext for aliases just use interface type as dependent member.
Much cleane. Also fixes one more validation crasher.
2016-03-22 23:13:10 -07:00
Daniel Duan
f1a1b0e752 [Sema] add a crasher 2016-03-15 00:33:08 -07:00
Dmitri Gribenko
0f36bec31f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-18 16:41:35 -08:00
Daniel Duan
f2e3d0be23 [SILGen] add a crasher in Type Lowering 2016-02-17 22:40:02 -08:00
Chris Lattner
2f78b70857 recent diagnostics changes fixed 5 crashers and broke 1. 2016-01-11 22:43:27 -08:00
Maxim Moiseev
844b81c46b SequenceType => Sequence 2015-12-09 17:16:56 -08:00
Dmitri Gribenko
2cf172160c Rename SequenceType.Generator associated type to SequenceType.Iterator 2015-12-09 17:11:05 -08:00
Doug Gregor
2038a8e837 Handle nested types of concrete types in the constraint solver.
... I have no idea why we were foolishly mapping such things to their
parent type, which made no sense whatsoever. Fixes
rdar://problem/21621421.

Swift SVN r29882
2015-07-02 04:45:15 +00:00
Doug Gregor
4ce98a2b0d Fix RUN line; this isn't passing
Swift SVN r29871
2015-07-02 00:11:23 +00:00
Doug Gregor
9479679e4e Add test from rdar://problem/21621421.
Swift SVN r29870
2015-07-02 00:08:27 +00:00
Doug Gregor
87b4eeccf3 Make same-type requirements prefer to be rooted at outer generic parameters.
All archetypes from outer scopes are fixed (as a lame implementation
restriction), so same-type constraints that involve archetypes from
outer scopres should treat the archetypes from outer scopes as the
representative. Do so, and start eliminating the notion of a "primary"
archetype that was preventing this fix from occurring earlier, so that
"all archetypes" and the set of requirements generated from the
archetype builder still line up.

Fixes rdar://problem/19519590.

Swift SVN r29869
2015-07-02 00:08:24 +00:00
Slava Pestov
7b2aa2c0a2 SILGen: Fix lvalue reabstraction
We didn't have any tests exercising SubstToOrigComponent and in
fact it was broken. Fix emitInOut() to remove a level of inout
from the origParam abstraction pattern and add some tests.

Fixes <rdar://problem/20985062>.

Swift SVN r29644
2015-06-24 22:27:54 +00:00
Doug Gregor
a7225aa51c Add compiler crasher from rdar://problem/19519590.
Swift SVN r29119
2015-05-28 23:24:23 +00:00
Dmitri Hrybenko
67624d0521 Add a testcase for rdar://20256475
Swift SVN r29118
2015-05-28 23:06:16 +00:00
Dmitri Hrybenko
eac42662dc Add a failing test case for rdar://20985062
Swift SVN r28653
2015-05-16 00:29:15 +00:00
Joe Groff
1af4659c4a Enable interface type mangling.
Fixes rdar://problem/18034517, and addresses a number of compiler crashers due to symbol collisions in the old mangling.

Swift SVN r28383
2015-05-09 22:20:57 +00:00
Chris Willmore
6849d8d7bc Only run 20740573 test case if ObjC interop is available.
Swift SVN r27916
2015-04-29 18:25:04 +00:00
Chris Willmore
2d4bcfc0f9 Add test case from 20740573, fixed by r27901.
Swift SVN r27912
2015-04-29 17:12:53 +00:00
Doug Gregor
0523a09560 Update validation testsuite for the argument label default changes.
Swift SVN r27706
2015-04-24 20:31:43 +00:00
Dmitri Hrybenko
de1917b597 Disable a crash test in no-asserts builds
Swift SVN r27271
2015-04-14 03:36:20 +00:00
Doug Gregor
3805e18090 Explicitly track the mapping from dependent types to their opened type variables.
Previously, we were reconstructing this mapping from the "full" opened
type produced by declaration references. However, when dealing with
same-type constraints between associated types and type parameters, we
could end up with an incomplete mapping, which let archetypes slip
through. Most of the churn here is sorting out the locators we need to
use to find the opened-type information. Fixes rdar://problem/18208283
and at least 3 dupes of it that I've found so far.

Swift SVN r25375
2015-02-18 19:41:40 +00:00
Dmitri Hrybenko
4bc91af128 Annotate that 0002-rdar19792768.swift only crashes with assertions
enabled

Swift SVN r25189
2015-02-11 19:36:42 +00:00
Ben Langmuir
afd4f98a6b Add XFAIL: no_asserts to compiler_crashers_2/0001-rdar19792730.swift
Swift SVN r25181
2015-02-11 17:33:30 +00:00
Dmitri Hrybenko
b76f6b27ec Add tests for compiler crasher bugs that I filed recently
If these tests start passing, we would conveniently know which bugs we
can close.

Swift SVN r25170
2015-02-11 07:12:19 +00:00