Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'BaseNode' initializer is inaccessible due to 'internal' protection level #196

Closed
daikini opened this issue Jan 3, 2020 · 1 comment
Closed

Comments

@daikini
Copy link

daikini commented Jan 3, 2020

Please help prevent duplicate issues before submitting a new one:

  • [x ] I've searched other open/closed issues for duplicates before opening up this new issue.

Report

Swift requires that struct initializers be made public when used outside the module they are declared in. This is required even if the struct itself has been made public.

What did you do?

Tried to initialize the Document struct in a different module than the Down module.

let document = Document(cmarkNode: tree)

What did you expect to happen?

Expected the code to compile.

What happened instead?

Swift reported a compile error of:

'Document' initializer is inaccessible due to 'internal' protection level
@daikini
Copy link
Author

daikini commented Jan 4, 2020

As @johnxnguyen noted here it is possible to get a reference to the Document by doing something like:

let down = Down(markdownString:...)
let document = try? down.toAST().wrap() as? Document
...

@daikini daikini closed this as completed Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant