Investigate isSameType(Type, Type) #96

Open
opened 2023-01-29 13:38:00 +00:00 by deavmi · 4 comments
Owner

What is this?

Look at how isSameType(Type type1, Type type2) is implemented.

### What is this? Look at how `isSameType(Type type1, Type type2)` is implemented.
deavmi added this to the Basics milestone 2023-01-29 13:38:00 +00:00
deavmi added the
typing
label 2023-01-29 13:38:00 +00:00
deavmi self-assigned this 2023-01-29 13:38:00 +00:00
deavmi added this to the Dependency tree, type-checking and codegen project 2023-01-29 13:38:01 +00:00
deavmi added a new dependency 2023-01-29 13:38:19 +00:00
Author
Owner

Question 1

Is var.type = var2.type alright, referencing it rather than a refercne to a copy?

We should never change types so I I don't see why it would be wrong?

## Question 1 Is var.type = var2.type alright, referencing it rather than a refercne to a copy? We should never change types so I I don't see why it would be wrong?
Author
Owner

Bug 1 - simple_pointers.t failure

It would seem that we get the following segmentation fault when dealing with pointers - has to do with getType(<pointer>) I think:

[INFO] VariableType: int
[INFO] LeftHandType: null
Segmentation fault (core dumped)

👉 Correction: It is the function call that has no type yet set:

[WARNING] VaribleAssignmentNode(): Just popped off valInstr?: [Instruction: compiler.codegen.instruction.FuncCallInstr:FunctionName: function EvalInstrs: [[Instruction: compiler.codegen.instruction.UnaryOpInstr:UnaryOpType: AMPERSAND, Instr: [Instruction: compiler.codegen.instruction.FetchValueVar:fetchVarValName: simple_pointer.j, VarLen: 4]]]]

I'm dumb, we must popType() smh:

Type variableType = getType(variableAssignmentContext.getContainer(), assignTo.getType());
Type rightHandType = popType();
## Bug 1 - `simple_pointers.t` failure It would seem that we get the following segmentation fault when dealing with pointers - has to do with `getType(<pointer>)` I think: ❎ ``` [INFO] VariableType: int [INFO] LeftHandType: null Segmentation fault (core dumped) ``` --- 👉 **Correction**: It is the function call that has no type yet set: ``` [WARNING] VaribleAssignmentNode(): Just popped off valInstr?: [Instruction: compiler.codegen.instruction.FuncCallInstr:FunctionName: function EvalInstrs: [[Instruction: compiler.codegen.instruction.UnaryOpInstr:UnaryOpType: AMPERSAND, Instr: [Instruction: compiler.codegen.instruction.FetchValueVar:fetchVarValName: simple_pointer.j, VarLen: 4]]]] ``` --- I'm dumb, we must `popType()` smh: ```d Type variableType = getType(variableAssignmentContext.getContainer(), assignTo.getType()); Type rightHandType = popType(); ```
deavmi changed title from Investigate `isSamtType(Type, Type)` to Investigate `isSameType(Type, Type)` 2023-01-29 14:10:23 +00:00
Author
Owner

Okay, so this method should probably be very dumb and just check equality as it does I guess. We just need to ensure it does that.

  • Ensure exactly what isSameType(Type t1, Type t2) is meant to do
Okay, so this method should probably be very dumb and just check equality as it does I guess. We just need to ensure it does that. - [ ] Ensure exactly what `isSameType(Type t1, Type t2)` is **meant** to do
deavmi added the due date 2023-02-05 2023-02-04 12:39:04 +00:00
deavmi modified the due date from 2023-02-05 to 2023-02-13 2023-02-11 09:49:15 +00:00
Author
Owner

I should close this lmao

I should close this lmao
deavmi removed a dependency 2023-07-22 13:37:50 +01:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

2023-02-13

Dependencies

No dependencies set.

Reference: tlang/tlang#96
No description provided.