Skip to content

builtin contract name collision? #3

@noschiff

Description

@noschiff

This is accepted

contract Contract {
    Contract{any} addr;
    constructor() { super(); }

    @public void foo{sender->this} () {
        addr.foo();
    }
}

Replacing Contract with A is rejected. I think this is because we use Contract as a base type.

Task :run FAILED
/Users/noah/Cornell/SCIF/compiler/./.scif/ntc0.cons | <----
The program type-checks.
/Users/noah/Cornell/SCIF/compiler/./.scif/foo0.ifc | <----
Static type error.
Code locations most likely to be wrong:

  1. main.scif, line 6, column 14:
    Target contract must be trusted to call this method.
    addr.foo();
    ^

  2. main.scif, line 2, column 12:
    Variable addr may be labeled incorrectly.
    A{any} addr;
    ^

11 actionable tasks: 7 executed, 4 up-to-date
Checking contract LockManager
Checking contract TrustManager
Checking contract Contract
Checking contract ManagedContract
Checking contract ContractImp
Checking contract ExternallyManagedContract
Checking contract ManagedContractImp
Checking contract ExternallyManagedContractImp
Checking contract A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions