Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type checking of type members invariance is broken #374

Open
potanin opened this issue Apr 21, 2020 · 0 comments
Open

Type checking of type members invariance is broken #374

potanin opened this issue Apr 21, 2020 · 0 comments

Comments

@potanin
Copy link
Member

potanin commented Apr 21, 2020

The attached code compiles when it should not. The commented out line:

setCell(PointB, cell2d)

gives the appropriat error:

The callee method cannot accept actual arguments with types: 'Point3D, Cell[Point2D]; expected types __generic__T.T, Cell[__generic__T.T]' at location file test.wyv on line 41 column 1

But we also expect this error on this line:

setCell(pointA, cell3d)

Which compiles even with explicit [Point2D] annotation:

setCell[Point2D](pointA, cell3d)

It appears the type member subtype check for bounds is the cause of this so invariance cannot be enforced. A final proper fix would be to implement the full decidable type checking of type members form Julian's PhD thesis of course!

Rename this file back to .wyv as GitBug blocks it:

test.wyv.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant