File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed
validation-test/compiler_crashers_2_fixed Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 792ce192f89160fd693f58a5bdbe1b66e1ce6df4
2
+ refs/heads/master: b33a46b24edcb4feb34af5c73e37c7701aec1105
3
3
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
4
4
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
5
5
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
Original file line number Diff line number Diff line change @@ -429,6 +429,14 @@ mapParsedParameters(Parser &parser,
429
429
paramNameLoc, paramName,
430
430
parser.CurDeclContext );
431
431
param->getAttrs () = paramInfo.Attrs ;
432
+
433
+ auto setInvalid = [&]{
434
+ if (param->isInvalid ())
435
+ return ;
436
+ param->getTypeLoc ().setInvalidType (ctx);
437
+ param->setInvalid ();
438
+ };
439
+
432
440
bool parsingEnumElt
433
441
= (paramContext == Parser::ParameterContextKind::EnumElement);
434
442
// If we're not parsing an enum case, lack of a SourceLoc for both
@@ -438,7 +446,7 @@ mapParsedParameters(Parser &parser,
438
446
439
447
// If we diagnosed this parameter as a parse error, propagate to the decl.
440
448
if (paramInfo.isInvalid )
441
- param-> setInvalid ();
449
+ setInvalid ();
442
450
443
451
// If a type was provided, create the type for the parameter.
444
452
if (auto type = paramInfo.Type ) {
@@ -462,8 +470,7 @@ mapParsedParameters(Parser &parser,
462
470
if (!param->isInvalid ())
463
471
parser.diagnose (param->getLoc (), diag::missing_parameter_type);
464
472
465
- param->getTypeLoc () = TypeLoc::withoutLoc (ErrorType::get (ctx));
466
- param->setInvalid ();
473
+ setInvalid ();
467
474
} else if (paramInfo.SpecifierLoc .isValid ()) {
468
475
StringRef specifier;
469
476
switch (paramInfo.SpecifierKind ) {
Original file line number Diff line number Diff line change
1
+ // RUN: not %target-swift-frontend -typecheck %s
2
+
3
+ func receive( ) { }
4
+ func test( ) {
5
+ receive { ( dat: Container<> ) in
6
+ dat
7
+ }
8
+ }
You can’t perform that action at this time.
0 commit comments