Giter Site home page Giter Site logo

limbo-errors's Introduction

Common Limbo Compiler Errors

cannot be qualified

tttfs.b:93: 'game' of type Game cannot be qualified with ->

In this case Game is an adt type and game is defined as game: Game.

What Limbo wants, is game to be defined as game: ref Game.

link typecheck

link typecheck main->init() 0/4244b354

Something similar to this means that your init() function's signature does not match what is expected.

For a program intended to be run from the shell, etc. the proper signature is similar to:

MyModuleName: module {
	init: fn(nil: ref Draw->Context, argv: list of string);
};

init(nil: ref Draw->Context, argv: list of string) {
...
}

Typically I see this when I drop the ref in ref Draw->Context somewhere.

are not compatible

poly.b:66: fn(a: T, b: T): int and fn(a: Integral, b: Integral): int are not compatible wrt eq
poly.b:66: function call type mismatch (fn[T](x: T, a: array of T): array of T vs fn[T](nil: ref Integral, nil: array of ref Integral): array of T)

The eq() function has the signature:

eq:		fn(a, b: Integral): int;

Note the absence of the ref keyword.

A satisfying implementation would resemble:

Integral: adt {
	n: int;
	eq:		fn(a, b: ref Integral): int;
	String:	fn(x: self ref Integral): string;
};

Integral.eq(a, b: ref Integral): int {
	return a.n == b.n;
}

limbo-errors's People

Contributors

henesy avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.