Open aturley opened 5 years ago
This is probably related to the "accidental" "fixing" of https://github.com/ponylang/ponyc/issues/539.
That is, that issue got magically resolved without anyone actually trying to do so, but that resolution probably has bugs, as evidenced by this segfault.
Environment
OS: MacOS 10.13.6
Ponyc: 0.25.0-232a0abe1 [release] compiled with: llvm 3.9.1 -- Apple LLVM version 9.1.0 (clang-902.0.39.2) Defaults: pic=false ssl=openssl_0.9.0
Description
The compiler segfaults if there is a function call to a function with a default parameter that is private and not visible to the caller.
Steps to Reproduce
I've created a class called
DoIt
with anapply
method that takes anFn
object as an argument, but the parameter has a default value of_DefaultFn
.DoIt()
is then called frommain.pony
, which is in another module and therefore cannot see_DefaultFn
.Create a directory that looks like this:
where
fn.pony
looks like this:and
subdir/main.pony
looks like this:From the
subdir
directory, run the Pony compiler like this:Expected Behavior
My expectation was that this would compile. If there's a reason it shouldn't compile then the compiler should generate an error.
Actual Behavior
The compiler segfaults. Here's the lldb backtrace: