@@ -2471,44 +2471,48 @@ class Verifier : public ASTWalker {
2471
2471
Out << " property getter has parameters\n " ;
2472
2472
abort ();
2473
2473
}
2474
- Type getterResultType = getter->getResultInterfaceType ();
2475
- getterResultType =
2476
- var->getDeclContext ()->mapTypeIntoContext (getterResultType);
2477
- if (!getterResultType->isEqual (typeForAccessors)) {
2478
- Out << " property and getter have mismatched types: '" ;
2479
- typeForAccessors.print (Out);
2480
- Out << " ' vs. '" ;
2481
- getterResultType.print (Out);
2482
- Out << " '\n " ;
2483
- abort ();
2474
+ if (getter->hasInterfaceType ()) {
2475
+ Type getterResultType = getter->getResultInterfaceType ();
2476
+ getterResultType =
2477
+ var->getDeclContext ()->mapTypeIntoContext (getterResultType);
2478
+ if (!getterResultType->isEqual (typeForAccessors)) {
2479
+ Out << " property and getter have mismatched types: '" ;
2480
+ typeForAccessors.print (Out);
2481
+ Out << " ' vs. '" ;
2482
+ getterResultType.print (Out);
2483
+ Out << " '\n " ;
2484
+ abort ();
2485
+ }
2484
2486
}
2485
2487
}
2486
2488
}
2487
2489
2488
2490
if (const FuncDecl *setter = var->getSetter ()) {
2489
- if (!setter->getResultInterfaceType ()->isVoid ()) {
2490
- Out << " property setter has non-Void result type\n " ;
2491
- abort ();
2492
- }
2493
- if (setter->getParameters ()->size () == 0 ) {
2494
- Out << " property setter has no parameters\n " ;
2495
- abort ();
2496
- }
2497
- if (setter->getParameters ()->size () != 1 ) {
2498
- Out << " property setter has 2+ parameters\n " ;
2499
- abort ();
2500
- }
2501
- const ParamDecl *param = setter->getParameters ()->get (0 );
2502
- Type paramType = param->getInterfaceType ();
2503
- if (!var->getDeclContext ()->contextHasLazyGenericEnvironment ()) {
2504
- paramType = var->getDeclContext ()->mapTypeIntoContext (paramType);
2505
- if (!paramType->isEqual (typeForAccessors)) {
2506
- Out << " property and setter param have mismatched types:\n " ;
2507
- typeForAccessors.dump (Out, 2 );
2508
- Out << " vs.\n " ;
2509
- paramType.dump (Out, 2 );
2491
+ if (setter->hasInterfaceType ()) {
2492
+ if (!setter->getResultInterfaceType ()->isVoid ()) {
2493
+ Out << " property setter has non-Void result type\n " ;
2494
+ abort ();
2495
+ }
2496
+ if (setter->getParameters ()->size () == 0 ) {
2497
+ Out << " property setter has no parameters\n " ;
2510
2498
abort ();
2511
2499
}
2500
+ if (setter->getParameters ()->size () != 1 ) {
2501
+ Out << " property setter has 2+ parameters\n " ;
2502
+ abort ();
2503
+ }
2504
+ const ParamDecl *param = setter->getParameters ()->get (0 );
2505
+ Type paramType = param->getInterfaceType ();
2506
+ if (!var->getDeclContext ()->contextHasLazyGenericEnvironment ()) {
2507
+ paramType = var->getDeclContext ()->mapTypeIntoContext (paramType);
2508
+ if (!paramType->isEqual (typeForAccessors)) {
2509
+ Out << " property and setter param have mismatched types:\n " ;
2510
+ typeForAccessors.dump (Out, 2 );
2511
+ Out << " vs.\n " ;
2512
+ paramType.dump (Out, 2 );
2513
+ abort ();
2514
+ }
2515
+ }
2512
2516
}
2513
2517
}
2514
2518
@@ -3010,6 +3014,16 @@ class Verifier : public ASTWalker {
3010
3014
void verifyChecked (AbstractFunctionDecl *AFD) {
3011
3015
PrettyStackTraceDecl debugStack (" verifying AbstractFunctionDecl" , AFD);
3012
3016
3017
+ if (!AFD->hasValidSignature ()) {
3018
+ if (isa<AccessorDecl>(AFD) && AFD->isImplicit ())
3019
+ return ;
3020
+
3021
+ Out << " All functions except implicit accessors should be "
3022
+ " validated by now\n " ;
3023
+ AFD->dump (Out);
3024
+ abort ();
3025
+ }
3026
+
3013
3027
// If this function is generic or is within a generic context, it should
3014
3028
// have an interface type.
3015
3029
if (AFD->isGenericContext () !=
0 commit comments