Skip to content

Commit db65ba8

Browse files
committed
[Typer] ArrayPointer to ConstArrayPointer
1 parent 45c7ce6 commit db65ba8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

source/compiler/typer.hexa

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,14 @@ class Typer {
16191619
}
16201620
}
16211621

1622+
if
1623+
toName == 'ConstArrayPointer',
1624+
fromName == 'ArrayPointer',
1625+
generic[0] == genericTo[0]
1626+
{
1627+
return to // Can cast to const
1628+
}
1629+
16221630
// TODO better comparison, not by name
16231631
if type.name == typeTo.name {
16241632
switch generic[0] {

0 commit comments

Comments
 (0)