mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
First, ensure all ParamDecls that are synthesized from scratch are given both a contextual type and an interface type. For ParamDecls written in source, add a new recordParamType() method to GenericTypeResolver. This calls setType() or setInterfaceType() as appropriate. Interestingly enough a handful of diagnostics in the test suite have improved. I'm not sure why, but I'll take it. The ParamDecl::createUnboundSelf() method is now only used in the parser, and no longer sets the type of the self parameter to the unbound generic type. This was wrong anyway, since the type was always being overwritten. This allows us to remove DeclContext::getSelfTypeOfContext(). Also, ensure that FuncDecl::getBodyResultTypeLoc() always has an interface type for synthesized declarations, eliminating a mapTypeOutOfContext() call when computing the function interface type in configureInterfaceType(). Finally, clean up the logic for resolving the DynamicSelfType. We now get the interface or contextual type of 'Self' via the resolver, instead of always getting the contextual type and patching it up inside configureInterfaceType().
152 KiB
152 KiB