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

Parse failure when omitting external name in completion block #463

Open
mattlawer opened this issue Nov 18, 2016 · 2 comments
Open

Parse failure when omitting external name in completion block #463

mattlawer opened this issue Nov 18, 2016 · 2 comments
Assignees
Labels

Comments

@mattlawer
Copy link

Tailor Version: v0.11.1

Swift Version: 3.0

Platform (Mac/Linux/Windows/CI): Mac

Installation Method: Homebrew

Steps to Reproduce Issue

make a new file Test.swift

import Foundation

class Test {
	
	func log(_ text: String, completion: (_ text: String) -> Void) {
		print(text)
		completion(text)
	}

}

Result
./Test.swift could not be parsed successfully, skipping...

Using --debug

Analyzing 1 file:
line 5:39 no viable alternative at input 'func log(_ text: String, completion: (_'
line 5:12 mismatched input 'text' expecting {';', '{', ',', '(', ')', '*', '<', '>', '==', '.', '=', '->', '...', '?', '!', 'is', 'as', '[', '-', '/', '&', '&&', '||', '>=', OperatorHead, '..'}
line 5:24 extraneous input ',' expecting {';', 'for', 'case', 'in', 'while', 'repeat', 'if', 'else', 'guard', 'switch', '{', '}', 'default', 'break', 'continue', 'fallthrough', 'return', 'throw', 'defer', 'do', 'catch', 'let', 'var', 'where', '#available', '(', '*', 'iOS', 'iOSApplicationExtension', 'OSX', 'watchOS', 'tvOS', '<', '>', '==', 'class', 'convenience', 'dynamic', 'final', 'infix', 'lazy', 'mutating', 'nonmutating', 'optional', 'override', 'postfix', 'prefix', 'required', 'static', 'unowned', 'safe', 'weak', 'private', 'set', 'fileprivate', 'internal', 'public', 'open', 'import', 'typealias', 'struct', 'enum', 'protocol', 'func', '.', '=', 'get', 'willSet', 'didSet', 'throws', 'rethrows', '->', '...', '_', 'indirect', 'associatedtype', 'init', '?', '!', 'deinit', 'extension', 'subscript', 'operator', 'precedence', 'associativity', 'left', 'right', 'none', 'is', 'as', '@', '[', '-', '/', '&', 'try', '#file', '#line', '#column', '#function', 'self', 'super', '#selector', '#keyPath', 'dynamicType', '&&', '||', '>=', 'Type', 'Protocol', 'Any', 'Self', 'inout', '#endif', '#if', '#elseif', '#else', 'os', 'arch', 'i386', 'x86_64', 'arm', 'arm64', '#sourceLocation', 'file', 'line', '#colorLiteral', 'fileLiteral', 'imageLiteral', 'OSXApplicationExtension­', BooleanLiteral, 'nil', OperatorHead, '..', Identifier, BinaryLiteral, OctalLiteral, DecimalLiteral, HexadecimalLiteral, FloatingPointLiteral, StringLiteral}
line 5:38 no viable alternative at input 'completion: ('
line 5:41 mismatched input 'text' expecting {';', '{', ',', '(', ')', '*', '<', '>', '==', '.', '=', '->', '...', '?', '!', 'is', 'as', '[', '-', '/', '&', '&&', '||', '>=', OperatorHead, '..'}
line 5:53 extraneous input ')' expecting {';', 'for', 'case', 'in', 'while', 'repeat', 'if', 'else', 'guard', 'switch', '{', '}', 'default', 'break', 'continue', 'fallthrough', 'return', 'throw', 'defer', 'do', 'catch', 'let', 'var', 'where', '#available', '(', '*', 'iOS', 'iOSApplicationExtension', 'OSX', 'watchOS', 'tvOS', '<', '>', '==', 'class', 'convenience', 'dynamic', 'final', 'infix', 'lazy', 'mutating', 'nonmutating', 'optional', 'override', 'postfix', 'prefix', 'required', 'static', 'unowned', 'safe', 'weak', 'private', 'set', 'fileprivate', 'internal', 'public', 'open', 'import', 'typealias', 'struct', 'enum', 'protocol', 'func', '.', '=', 'get', 'willSet', 'didSet', 'throws', 'rethrows', '->', '...', '_', 'indirect', 'associatedtype', 'init', '?', '!', 'deinit', 'extension', 'subscript', 'operator', 'precedence', 'associativity', 'left', 'right', 'none', 'is', 'as', '@', '[', '-', '/', '&', 'try', '#file', '#line', '#column', '#function', 'self', 'super', '#selector', '#keyPath', 'dynamicType', '&&', '||', '>=', 'Type', 'Protocol', 'Any', 'Self', 'inout', '#endif', '#if', '#elseif', '#else', 'os', 'arch', 'i386', 'x86_64', 'arm', 'arm64', '#sourceLocation', 'file', 'line', '#colorLiteral', 'fileLiteral', 'imageLiteral', 'OSXApplicationExtension­', BooleanLiteral, 'nil', OperatorHead, '..', Identifier, BinaryLiteral, OctalLiteral, DecimalLiteral, HexadecimalLiteral, FloatingPointLiteral, StringLiteral}
line 5:62 no viable alternative at input '-> Void)'
line 5:62 extraneous input ')' expecting {';', 'for', 'case', 'in', 'while', 'repeat', 'if', 'else', 'guard', 'switch', '{', '}', 'default', 'break', 'continue', 'fallthrough', 'return', 'throw', 'defer', 'do', 'catch', 'let', 'var', 'where', '#available', '(', '*', 'iOS', 'iOSApplicationExtension', 'OSX', 'watchOS', 'tvOS', '<', '>', '==', 'class', 'convenience', 'dynamic', 'final', 'infix', 'lazy', 'mutating', 'nonmutating', 'optional', 'override', 'postfix', 'prefix', 'required', 'static', 'unowned', 'safe', 'weak', 'private', 'set', 'fileprivate', 'internal', 'public', 'open', 'import', 'typealias', 'struct', 'enum', 'protocol', 'func', '.', '=', 'get', 'willSet', 'didSet', 'throws', 'rethrows', '->', '...', '_', 'indirect', 'associatedtype', 'init', '?', '!', 'deinit', 'extension', 'subscript', 'operator', 'precedence', 'associativity', 'left', 'right', 'none', 'is', 'as', '@', '[', '-', '/', '&', 'try', '#file', '#line', '#column', '#function', 'self', 'super', '#selector', '#keyPath', 'dynamicType', '&&', '||', '>=', 'Type', 'Protocol', 'Any', 'Self', 'inout', '#endif', '#if', '#elseif', '#else', 'os', 'arch', 'i386', 'x86_64', 'arm', 'arm64', '#sourceLocation', 'file', 'line', '#colorLiteral', 'fileLiteral', 'imageLiteral', 'OSXApplicationExtension­', BooleanLiteral, 'nil', OperatorHead, '..', Identifier, BinaryLiteral, OctalLiteral, DecimalLiteral, HexadecimalLiteral, FloatingPointLiteral, StringLiteral}
.

********** XXXX/Test.swift **********
XXXX/Test.swift:5:06: warning: [function-whitespace] Function should have at least one blank line after it
XXXX/Test.swift:5:12: warning: [parenthesis-whitespace] Parentheses content should not end with whitespace
XXXX/Test.swift:5:41: warning: [parenthesis-whitespace] Parentheses content should not end with whitespace

Analyzed 1 file, skipped 0 files, and detected 3 violations (0 errors, 3 warnings).

Expected Behavior

Parses file

Actual Behavior

Fails to parse file

@adityatrivedi
Copy link
Member

adityatrivedi commented Nov 21, 2016

Thank you for reporting this @mattlawer! We will try to get this fixed in the coming release.

@g0ddy
Copy link

g0ddy commented Jun 23, 2017

Any progress on this one? Its still blocking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants