@property
def conn_setup(self) -> IrcConnSetup:
'Constructed out of stored entries *including* unconfirmed ones.'
- kwargs: dict[str, Any] = {}
+ kwargs: dict[str, ClientDbType] = {}
for field_name in IrcConnSetup._fields:
- kwargs[field_name] = self._dict.get(field_name, None)
- return IrcConnSetup(**kwargs)
+ val = self._dict.get(field_name, None)
+ if val is None:
+ raise CrashingException(f'field not set: {field_name}')
+ if not isinstance(val, IrcConnSetup.__annotations__[field_name]):
+ raise CrashingException(
+ f'wrong type for {field_name}: {type(val)} (value: {val})')
+ kwargs[field_name] = val
+ return IrcConnSetup(**kwargs) # type: ignore # enough tests above
@property
def caps(self) -> dict[str, _ServerCapability]: