RejectedSoftware Forums

Sign up

Error: @safe cannot call @system

Request some assistance in resolving the following please:

../../.dub/packages/vibe-d-0.7.31/vibe-d/source/vibe/http/server.d(286,33): Deprecation: alias diet.traits.FilterCallback is deprecated - Use SafeFilterCallback instead.

Compiling Diet HTML template index.dt...
index.dt(10,68): Error: @safe delegate 'vibe.http.server.staticTemplate!"index.dt".staticTemplate.__lambda1.compileHTMLDietFileString!("index.dt", "dtype 5\x0ahead\x0a    title Code filter example\x0a    :css\x0a        .keyword { color: #0000ff;\x0a            font-weight: bold; }\x0abody\x0a    p You can create your own functions.\x0a    :dcode\x0a        T max(T)(T a, T b) {\x0a            return a > b ? a : b;\x0a        }", req, DefaultFilters).exec!(StreamOutputRange).exec.__lambda2' cannot call @system function 'vibe.stream.wrapper.StreamOutputRange.put'

index.dt(10,68): Error: @safe delegate 'vibe.http.server.staticTemplate!"index.dt".staticTemplate.__lambda1.compileHTMLDietFileString!("index.dt", "dtype 5\x0ahead\x0a    title Code filter example\x0a    :css\x0a        .keyword { color: #0000ff;\x0a            font-weight: bold; }\x0abody\x0a    p You can create your own functions.\x0a    :dcode\x0a        T max(
T)(T a, T b) {\x0a            return a > b ? a : b;\x0a        }", req, DefaultFilters).exec!(StreamOutputRange).exec.__lambda2' cannot call @system function 'vibe.stream.wrapper.StreamOutputRange.put'
../../.dub/packages/diet-ng-1.2.1/diet-ng/source/diet/html.d(115,7): Error: template instance vibe.http.server.staticTemplate!"index.dt".staticTemplate.__lambda1.compileHTMLDietFileString!("index.dt", "dtype 5\x0ahead\x0a    title Code filter example\x0a    :css\x0a        .keyword { color: #0000ff;\x0a            font-weight: bold; }\x0abody\x0a    p You can create your own functions.\x0a    :dcode\x0a        T max(T)(T a, T b) {\x0a            return a > b ? a : b;\x0a        }", req, DefaultFilters).exec!(StreamOutputRange) error instantiating
../../.dub/packages/vibe-d-0.7.31/vibe-d/source/vibe/http/server.d(213,63):        instantiated from here: compileHTMLDietFileString!(StreamOutputRange)
../../.dub/packages/vibe-d-0.7.31/vibe-d/source/vibe/http/server.d(139,6):        instantiated from here: render!("index.dt", req) source/app.d(13,23):        instantiated from here: staticTemplate!"index.dt"

Pretty sure the second error is caused by the first but unsure how to resolve the first.

Re: Error: @safe cannot call @system

Am 03.06.2017 um 02:28 schrieb Andrew Edwards:

Request some assistance in resolving the following please:

../../.dub/packages/vibe-d-0.7.31/vibe-d/source/vibe/http/server.d(286,33): Deprecation: alias diet.traits.FilterCallback is deprecated - Use SafeFilterCallback instead.

Compiling Diet HTML template index.dt...
index.dt(10,68): Error: @safe delegate 'vibe.http.server.staticTemplate!"index.dt".staticTemplate.__lambda1.compileHTMLDietFileString!("index.dt", "dtype 5\x0ahead\x0a    title Code filter example\x0a    :css\x0a        .keyword { color: #0000ff;\x0a            font-weight: bold; }\x0abody\x0a    p You can create your own functions.\x0a    :dcode\x0a        T max(T)(T a, T b) {\x0a            return a > b ? a : b;\x0a        }", req, DefaultFilters).exec!(StreamOutputRange).exec.__lambda2' cannot call @system function 'vibe.stream.wrapper.StreamOutputRange.put'

index.dt(10,68): Error: @safe delegate 'vibe.http.server.staticTemplate!"index.dt".staticTemplate.__lambda1.compileHTMLDietFileString!("index.dt", "dtype 5\x0ahead\x0a    title Code filter example\x0a    :css\x0a        .keyword { color: #0000ff;\x0a            font-weight: bold; }\x0abody\x0a    p You can create your own functions.\x0a    :dcode\x0a        T max(
T)(T a, T b) {\x0a            return a > b ? a : b;\x0a        }", req, DefaultFilters).exec!(StreamOutputRange).exec.__lambda2' cannot call @system function 'vibe.stream.wrapper.StreamOutputRange.put'
../../.dub/packages/diet-ng-1.2.1/diet-ng/source/diet/html.d(115,7): Error: template instance vibe.http.server.staticTemplate!"index.dt".staticTemplate.__lambda1.compileHTMLDietFileString!("index.dt", "dtype 5\x0ahead\x0a    title Code filter example\x0a    :css\x0a        .keyword { color: #0000ff;\x0a            font-weight: bold; }\x0abody\x0a    p You can create your own functions.\x0a    :dcode\x0a        T max(T)(T a, T b) {\x0a            return a > b ? a : b;\x0a        }", req, DefaultFilters).exec!(StreamOutputRange) error instantiating
../../.dub/packages/vibe-d-0.7.31/vibe-d/source/vibe/http/server.d(213,63):        instantiated from here: compileHTMLDietFileString!(StreamOutputRange)
../../.dub/packages/vibe-d-0.7.31/vibe-d/source/vibe/http/server.d(139,6):        instantiated from here: render!("index.dt", req) source/app.d(13,23):        instantiated from here: staticTemplate!"index.dt"

Pretty sure the second error is caused by the first but unsure how to resolve the first.

I'll have to check this, but it would be worth a try to upgrade to
vibe.d 0.8.0-rc.1. It's a bit odd that this isn't caught by the CI checks.

Re: Error: @safe cannot call @system

On Mon, 26 Jun 2017 20:48:44 +0200, Sönke Ludwig wrote:

I'll have to check this, but it would be worth a try to upgrade to
vibe.d 0.8.0-rc.1. It's a bit odd that this isn't caught by the CI checks.

I've gotten away from reading that book on the account that I need to improve my knowledge of programming on a whole so that I can work around the issues I'm encountering... Just finished Programming in D and am now embarking on Learning D. I will return to this after I've finished Adam's D Cookbook. By then I should be a bit more self-reliant. Thanks for looking into this and yes, I will surely be using 0.8.0 when I return to this.