@@ -299,10 +299,13 @@ class SILGenVTable : public Lowering::ASTVisitor<SILGenVTable> {
299299};
300300
301301static void emitTypeMemberGlobalVariable (SILGenModule &SGM,
302- GenericParamList *generics,
303- NominalTypeDecl *theType,
304302 VarDecl *var) {
305- assert (!generics && " generic static properties not implemented" );
303+ if (var->getDeclContext ()->isGenericContext ()) {
304+ assert (var->getDeclContext ()->getGenericSignatureOfContext ()
305+ ->areAllParamsConcrete ()
306+ && " generic static vars are not implemented yet" );
307+ }
308+
306309 if (var->getDeclContext ()->getAsClassOrClassExtensionContext ()) {
307310 assert (var->isFinal () && " only 'static' ('class final') stored properties are implemented in classes" );
308311 }
@@ -405,8 +408,7 @@ class SILGenType : public TypeMemberVisitor<SILGenType> {
405408 // Collect global variables for static properties.
406409 // FIXME: We can't statically emit a global variable for generic properties.
407410 if (vd->isStatic () && vd->hasStorage ()) {
408- return emitTypeMemberGlobalVariable (SGM, theType->getGenericParams (),
409- theType, vd);
411+ return emitTypeMemberGlobalVariable (SGM, vd);
410412 }
411413
412414 visitAbstractStorageDecl (vd);
@@ -494,8 +496,7 @@ class SILGenExtension : public TypeMemberVisitor<SILGenExtension> {
494496 assert (vd->isStatic () && " stored property in extension?!" );
495497 ExtensionDecl *ext = cast<ExtensionDecl>(vd->getDeclContext ());
496498 NominalTypeDecl *theType = ext->getExtendedType ()->getAnyNominal ();
497- return emitTypeMemberGlobalVariable (SGM, ext->getGenericParams (),
498- theType, vd);
499+ return emitTypeMemberGlobalVariable (SGM, vd);
499500 }
500501 visitAbstractStorageDecl (vd);
501502 }
0 commit comments