Closed jvasileff closed 8 years ago
@lucaswerkmeister re you're Gitter question
it looks like you’ve managed to get a package literal with a non-null, but empty import path how?
it must be that the type checker fills in this info when full type checking is performed. For the program:
Anything p = `package`;
I get:
$ ceylon compile-dart --verbose=ast,rhAst
...
-- Redhat AST simple/run.ceylon
+ [CompilationUnit] (1:0-1:22)
| + [ImportList]
| + [AttributeDeclaration] (1:0-1:22) : value p => Anything
| | + [AnnotationList]
| | + p [Identifier] (1:9-1:9)
| | + [BaseType] (1:0-1:7) : Anything : class Anything()
| | | + Anything [Identifier] (1:0-1:7)
| | + = [SpecifierExpression] (1:11-1:21)
| | | + [Expression] (1:13-1:21) : Package
| | | | + `` [PackageLiteral] (1:13-1:21) : Package
| | | | | + [ImportPath]
------------------------------------------------------------
** Compiler bug! **
------------------------------------------------------------
Assertion failed
violated nonempty components = CeylonIterable(fullPackageName.identifiers).collect(propagateUpdate(pIdentifierToCeylon, update))
was encountered while compiling the file:
source/simple/run.ceylon
------------------------------------------------------------
Exception in thread "main" ceylon.language.AssertionError "Assertion failed
violated nonempty components = CeylonIterable(fullPackageName.identifiers).collect(propagateUpdate(pIdentifierToCeylon, update))"
at ceylon.ast.redhat.fullPackageNameToCeylon_.fullPackageNameToCeylon(FullPackageName.ceylon:17)
at ceylon.ast.redhat.packageDecToCeylon_.packageDecToCeylon(PackageDec.ceylon:16)
at ceylon.ast.redhat.decToCeylon_.decToCeylon(Dec.ceylon:32)
Ah, looks like ExpressionVisitor.java
is the null
hater (or null burier?):
Module literals may also be affected.
Indeed it does: ExpressionVisitor.java:8847
. I thought it would create a proper import path with the correct components, but it looks like it doesn’t. Alright.
Github tells me I beat you by 1s :)
GitHub doesn’t even tell me second-precise timestamps :(
So yes, Anything p = `module`;
also fails with:
Exception in thread "main" ceylon.language.AssertionError "Assertion failed
violated nonempty components = CeylonIterable(fullPackageName.identifiers).collect(propagateUpdate(pIdentifierToCeylon, update))"
at ceylon.ast.redhat.fullPackageNameToCeylon_.fullPackageNameToCeylon(FullPackageName.ceylon:17)
at ceylon.ast.redhat.moduleDecToCeylon_.moduleDecToCeylon(ModuleDec.ceylon:16)
at ceylon.ast.redhat.decToCeylon_.decToCeylon(Dec.ceylon:33)
at ceylon.ast.redhat.primaryToCeylon_.primaryToCeylon(Primary.ceylon:47)
Should be fixed in branch fix105
, can you try it out?
(class
and interface
should be fine afaict.)
works great, thanks!
BTW, a nice tool for testing this sort of thing is ceylon compile-dart --verbose=ast,rhAst
:)
Alright, pushed to master then :)
And it seems like your compiler is a great way to debug ceylon.ast on typechecked ASTs, so I guess I’ll install it :D
On 08.12.2015 01:17, John Vasileff wrote:
works great, thanks!
BTW, a nice tool for testing this sort of thing is |ceylon compile-dart --verbose=ast,rhAst| :)
— Reply to this email directly or view it on GitHub https://github.com/ceylon/ceylon.ast/issues/105#issuecomment-162712618.
Section 6.10.2. Package and module references allows package-name-less package reference expressions (
package
):but
ceylon.ast.redhat
blows up with:This is supported by the api of
PackageDec
, aspackageName
is optional.