Comments (4)
Code in question:
actor Main
new create(env: Env) =>
Foo[String box](env, "message")
Foo[String box].double()(env, "message")
trait Printer[T: Stringable box]
fun apply(env: Env, msg: T)
fun double(): Printer[T] =>
object ref is Printer[T]
fun apply(env: Env, msg: T) =>
env.out.print("First " + msg.string())
env.out.print("Second " + msg.string())
end
class Foo[T: Stringable box] is Printer[T]
fun apply(env: Env, msg: T) =>
env.out.print("Just one " + msg.string())
from ponyc.
Here's the backtrace from a debug version of the compiler:
/home/sean/code/ponylang/ponyc/src/libponyc/pass/expr.c:661: pass_expr: Assertion `errors_get_count(options->check.errors) > 0` failed.
Backtrace:
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ponyint_assert_fail+0x96) [0x555555d2afb6]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(pass_expr+0x534) [0x555555c868e4]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x2a4) [0x555555c87224]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(+0x733ce6) [0x555555c87ce6]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(+0x7336aa) [0x555555c876aa]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_passes_type+0x114) [0x555555c879f4]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(+0x7bc485) [0x555555d10485]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(expr_object+0x1a15) [0x555555d0f905]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(pass_expr+0x422) [0x555555c867d2]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x2a4) [0x555555c87224]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_visit+0x1e4) [0x555555c87164]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(+0x733ce6) [0x555555c87ce6]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(+0x7336aa) [0x555555c876aa]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(ast_passes_program+0x22) [0x555555c872f2]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(program_load+0xb8) [0x555555ca9e58]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(+0x6d232c) [0x555555c2632c]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(main+0x261) [0x555555c261d1]
/lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7ffff7ca6d90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7ffff7ca6e40]
/home/sean/code/ponylang/ponyc/build/debug/ponyc(_start+0x25) [0x555555c25ea5]
Process 1091 stopped
* thread #1, name = 'ponyc', stop reason = signal SIGABRT
For the uninitated, when you go to look at pass_expr
, what this is indicating is that when we attempted to compile this, something returned false from an expression pass handling step (setting r
to false) but didn't get an error. That is "ungood".
from ponyc.
The AST item in question when we go boom appears to be a TK_DOT
.
tk_dot
ends up in entity_access
which definitely returns false
from some locations without setting an error.
Next step is additional debugging to figure out what is the unexpected bit and probably one of:
- how we getting this far without having already displayed an error earlier
- what was supposed to have been done earlier that wasn't
- what's the unhandled case
in all likelihood, its the first in that list.
from ponyc.
Changing to:
actor Main
new create(env: Env) =>
Foo[String box](env, "message")
Foo[String box].double()(env, "message")
trait Printer[T: Stringable box]
fun apply(env: Env, msg: T)
fun double(): Printer[T] =>
Foo[T]
class Foo[T: Stringable box] is Printer[T]
fun apply(env: Env, msg: T) =>
env.out.print("Just one " + msg.string())
fixes the issue, so, focus on the object literal when debugging.
from ponyc.
Related Issues (20)
- Non-sendable data seen as sendable
- Release 0.57.1 HOT 2
- Generic parameter when copying a trait method into an object that has a generic parameter of the same name HOT 2
- return usage in disposing block's is flawed and we need to revist. HOT 5
- Slow compare to elixir in `ring benchmark` HOT 2
- Clean up MacOS platform version setting HOT 1
- Release 0.58.0 HOT 1
- Release 0.58.1
- Invalid LLVM generated HOT 1
- Segmentation fault when ponyc compiles this code HOT 2
- Compile fails verification "GEP base pointer is not a vector or a vector of pointers" HOT 13
- LLVM mangling error with `powi` HOT 4
- Release 0.58.2
- Constrained Types RFC
- Segfault from bad cap in code
- Release 0.58.3
- Release 0.58.4 HOT 1
- Segfault when accessing a union in a tuple via `Any` HOT 4
- Improve error message for failure of generic subtyping of concrete types HOT 8
- Release 0.58.5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ponyc.