@infer_type.implementation(for_type=ast.Resolve)<EOL>def infer_type(expr, scope):
<EOL>if isinstance(expr.member, ast.Literal):<EOL><INDENT>member = expr.member.value<EOL><DEDENT>else:<EOL><INDENT>return protocol.AnyType<EOL><DEDENT>container_type = infer_type(expr.obj, scope)<EOL>try:<EOL><INDENT>return structured.reflect(container_type, member) or protocol.AnyType<EOL><DEDENT>except NotImplementedError:<EOL><INDENT>return protocol.AnyType<EOL><DEDENT>
Try to infer the type of x.y if y is a known value (literal).