To make this work, introduce impl bindings into scope immediately when type-checking. We may rely on their existence before we finish type-checking the enclosing pattern.
* check that the return type is a type, add more implicit conversions
* update IsConcreteType for generic classes, add IsType predicate
* delete a comment
* trivial change
* move Witness wrt IsConcreteType and IsType
* added comments to tests
* update error line numbers
Breaks `--trace` into two flags:
- `--parser_debug`, which sets the parser debug level (which I haven't dug into piping with `--trace`, but seemed likely to be troublesome)
- `--trace_file`, which now the type checker and interpreter will use for trace information (note compile errors should use a different channel)
Most of the file edits are just mechanical testdata flag updates: `sed -i 's/--trace/--parser_debug --trace_file=-/' testdata/**/*.carbon`
To explain the output paths:
- parse/compile errors: stderr
- print() calls: stdout
- parser tracing: `--parser_debug` option, stdout (formerly stdout if `--trace`)
- type check/compile tracing: `--trace_file=<file>`, giving `-` uses stdout (formerly stdout if `--trace`)
- return code of executed Carbon code: `--trace_file` if set, stdout if not (formerly stdout always)
* start of generic classes
* fix regressions
* class functions in interfaces
* access to class function on interface from class parameter
* more stuff working for generic classes
* fixing bugs
* update TypeEqual for generic classes
* fixing bugs and finding new ones
* disable unqualified access to members from other members for now
* minor edits
* bug fixes
* introduce compile_time_value to use in type checker instead of constant_value
* cleanup
* put a CHECK back in
* failure test cases for the new FATAL_COMPILATION_ERROR
* change a runtime FATAL into a FATAL_COMPILATION_ERROR
* Update executable_semantics/ast/declaration.h
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/action_stack.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/interpreter.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/value.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/value.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/interpreter.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/value.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/value.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/resolve_names.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/type_checker.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/type_checker.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/type_checker.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* responses to reviews
* Update executable_semantics/interpreter/type_checker.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* rename compile_time_value to symbolic_identity
* Update executable_semantics/interpreter/type_checker.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/type_checker.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/type_checker.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/type_checker.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/type_checker.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/type_checker.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/value.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/value.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* Update executable_semantics/interpreter/value.cpp
Co-authored-by: Jon Meow <jperkins@google.com>
* more edits from review
* Apply suggestions from code review
Co-authored-by: Geoff Romer <gromer@google.com>
* review responses
* Update executable_semantics/interpreter/interpreter.cpp
Co-authored-by: Geoff Romer <gromer@google.com>
* const impl_scope for TypeCheckChoiceDeclaration
* add some const
Co-authored-by: Jon Meow <jperkins@google.com>
Co-authored-by: Geoff Romer <gromer@google.com>