Skip to content

globals_and_class_thru_difficult but without the annotation #61

@HoneyPony

Description

@HoneyPony

I have at least gotten the topological sort working correctly for the globals_and_class_thru_difficult test. But, it still doesn't do the type inference correctly. For reference, this is the original test case:

var a = new Example{}.value;
var b = a;
var c = 10;

// In order to pass this test, we must be able to have a global depend on a class
// and a class depend on a global.

class Example {
    var value = c + d;
}

var d = 15;

fun init() {
    print(a, " ", b, " ", c, " ", d); //! 25 25 10 15
}

The test in the misc/ branch now has an : int annotation on var value.

In theory we should be able to inference all the types in this, however. I'm actually not totally sure why the type annotation is needed. Perhaps it's because we don't actually know the type of the global yet?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions