ceylon / ceylon-js

DEPRECATED
Apache License 2.0
54 stars 9 forks source link

Strange error with type() on JS #572

Closed jvasileff closed 9 years ago

jvasileff commented 9 years ago
import ceylon.language.meta {
    type
}

shared void run() {
    variable [Integer*] seq1 = []
        .withTrailing(1)
        .withTrailing(1)
        .withTrailing(1);
    print(seq1); // OK !?

    variable [Integer*] seq2 = [];
    seq2 = seq2.withTrailing(1);
    seq2 = seq2.withTrailing(1);
    seq2 = seq2.withTrailing(1);
    print(type(seq2)); // ERROR !?
}

produces:

$ ceylon compile-js && ceylon run-js simple
Note: Created module simple/1.0.0
[1, 1, 1]
/Users/jvasileff/Dropbox/Repos/ceylon/ceylon-dist/dist/repo/ceylon/language/1.1.1/ceylon.language-1.1.1.js:5608
if (mm.t) {
      ^
TypeError: Cannot read property 't' of undefined
    at qname$ (/Users/jvasileff/Dropbox/Repos/ceylon/ceylon-dist/dist/repo/ceylon/language/1.1.1/ceylon.language-1.1.1.js:5608:7)
    at simplename (/Users/jvasileff/Dropbox/Repos/ceylon/ceylon-dist/dist/repo/ceylon/language/1.1.1/ceylon.language-1.1.1.js:6254:4)
    at addtargs (/Users/jvasileff/Dropbox/Repos/ceylon/ceylon-dist/dist/repo/ceylon/language/1.1.1/ceylon.language-1.1.1.js:6272:4)
    at coistr$ (/Users/jvasileff/Dropbox/Repos/ceylon/ceylon-dist/dist/repo/ceylon/language/1.1.1/ceylon.language-1.1.1.js:6278:5)
    at Function.string (/Users/jvasileff/Dropbox/Repos/ceylon/ceylon-dist/dist/repo/ceylon/language/1.1.1/ceylon.language-1.1.1.js:6761:38)
    at stringify (/Users/jvasileff/Dropbox/Repos/ceylon/ceylon-dist/dist/repo/ceylon/language/1.1.1/ceylon.language-1.1.1.js:3764:586)
    at Object.print (/Users/jvasileff/Dropbox/Repos/ceylon/ceylon-dist/dist/repo/ceylon/language/1.1.1/ceylon.language-1.1.1.js:3761:64)
    at run (/Users/jvasileff/Transient/simple/modules/simple/1.0.0/simple-1.0.0.js:20:5)
    at [eval]:1:282
    at Object.exports.runInThisContext (vm.js:74:17)
jvasileff commented 9 years ago

Oops, meant to file to language. See https://github.com/ceylon/ceylon.language/issues/703