Initial implementation of 'new'

This doesn't yet call the constructor or use provided parameters and just allocates raw memory
This commit is contained in:
dcodeIO
2018-01-19 16:13:14 +01:00
parent ef7a095494
commit 64c939fdc4
12 changed files with 206 additions and 50 deletions

View File

@ -12,6 +12,7 @@ export enum DiagnosticCode {
Structs_cannot_implement_interfaces = 108,
Invalid_regular_expression_flags = 109,
Type_0_cannot_be_reinterpreted_as_type_1 = 110,
Implementation_0_must_match_the_signature_1 = 111,
Unterminated_string_literal = 1002,
Identifier_expected = 1003,
_0_expected = 1005,
@ -70,6 +71,7 @@ export enum DiagnosticCode {
_super_can_only_be_referenced_in_a_derived_class = 2335,
Property_0_does_not_exist_on_type_1 = 2339,
Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures = 2349,
Cannot_use_new_with_an_expression_whose_type_lacks_a_construct_signature = 2351,
A_function_whose_declared_type_is_not_void_must_return_a_value = 2355,
The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access = 2357,
The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access = 2364,
@ -101,6 +103,7 @@ export function diagnosticCodeToString(code: DiagnosticCode): string {
case 108: return "Structs cannot implement interfaces.";
case 109: return "Invalid regular expression flags.";
case 110: return "Type '{0}' cannot be reinterpreted as type '{1}'.";
case 111: return "Implementation '{0}' must match the signature '{1}'.";
case 1002: return "Unterminated string literal.";
case 1003: return "Identifier expected.";
case 1005: return "'{0}' expected.";
@ -159,6 +162,7 @@ export function diagnosticCodeToString(code: DiagnosticCode): string {
case 2335: return "'super' can only be referenced in a derived class.";
case 2339: return "Property '{0}' does not exist on type '{1}'.";
case 2349: return "Cannot invoke an expression whose type lacks a call signature. Type '{0}' has no compatible call signatures.";
case 2351: return "Cannot use 'new' with an expression whose type lacks a construct signature.";
case 2355: return "A function whose declared type is not 'void' must return a value.";
case 2357: return "The operand of an increment or decrement operator must be a variable or a property access.";
case 2364: return "The left-hand side of an assignment expression must be a variable or a property access.";