Skip to content

Instantly share code, notes, and snippets.

@Xliff
Last active October 11, 2020 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Xliff/483080e6329425240a8fa86a65bc28cc to your computer and use it in GitHub Desktop.
Save Xliff/483080e6329425240a8fa86a65bc28cc to your computer and use it in GitHub Desktop.
There should be only one....

However here, it looks like we have two different initialization codepaths!

Given this code:

use GIO::Roles::GFile; 
my $i; 
my $f = GIO::File.new_tmp("G_XXXXXX", $i); 
$f.say; 
$i.say; 
$i.unref; 
$f.get_path.say; 

my $f2 = GIO::File.new_for_path(".gitignore"); 
$f2.say

And this output:

Definitely here... (GIO::Raw::Definitions::GFile<94598997662704>)
GIO::Roles::File.new
GIO::FileIOStream.new

(process:120619): GLib-GIO-CRITICAL **: 14:46:02.479: g_file_get_path: assertion 'G_IS_FILE (file)' failed
(Str)
Thought we'd be here...
F: GIO::Raw::Definitions::GFile<94598998878048>
Now here...
GIO::File.new

It looks like $f does NOT go through the BUILD located here, yet when $f2 is initialized, it does.

I sinserely hope this is my bug. I really do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment