Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[bug] TypeMismatchs in courier gives weird line contexts #641

@Niels-Erik

Description

@Niels-Erik

Description
1:
If forward throws a TypeMismatch because the request part is wrong then the given line number comes from the next statement/symbol in the block.
2:
If the response is incorrect when operation bock is over then the given line number is the line that has the courier statement on.

To reproduce
1:
run operation nothing1 on embedder service on the code below, which gives the error line:
Source location: C:\...\test.ol:40

2:
run operation nothing2 on embedder service on the code below, which gives the error line:
Source location: C:\...\test.ol:33

code:

interface API {
	requestResponse:
		nothing1( void )( void ),
		nothing2( void )( void )
}

service nothing {
	execution: concurrent
	inputPort dateInput {
		location: "local"
		interfaces: API
	}

	main {
		[nothing1()()]
		[nothing2()()]
	}
}

interface extender noExtend {
	RequestResponse:
		*( void )( void ),
}

service embedder {
	embed nothing as nothing 

	inputPort input {
		location: "local"
		aggregates: nothing with noExtend
	}

	courier input {
		[nothing1( req )( res ) ] {
			req.wrong = 1
			forward( req )( res )



			nullProcess



		}
		[nothing2( req )( res ) ] {
			forward( req )( res )
			res.wrong = 5
		}
	}

	main { linkIn(l) }
}

service test {
	embed embedder as e

	main
	{
		nothing1@e()()
		nothing2@e()()
	}
}

Expected behaviour
1:
For problem 1 the expected outcome should be:
Source location: C:\...\test.ol:36
2:
For problem 1 the expected outcome should be:
Source location: C:\...\test.ol:45

Note: or they should be close/using the correct parsing context as #582 could be an issue after fix.

Desktop (please complete the following information):

  • OS: windows
  • Jolie version 1.13-git
  • Java Version 21

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions